On Tuesday 18 March 2014 20:05:07 Daniel Kahn Gillmor wrote: > On 03/18/2014 05:31 PM, Tim Rühsen wrote: > > $ wget -d --ca-certificate=ca-rsa-cert.pem > > --private-key=ca-rsa-key-plain.pem https://example.com:8443 > > 2014-03-18 21:48:04 (1.88 GB/s) - Read error at byte 5116 (The TLS > > connection was non-properly terminated.).Retrying. > > > > There seems to be a problem in Wget 1.15 (on Debian SID)... > > hm, i'll try to take a look at this.
I just took a look at it and it is not a bug, but might need some discussion. The server does not send a Content-Length header, so the number of expected bytes is unknown. Wget expects the server to properly close the connection to expect the transfer being ok. In our case, the connection shutdown by the server generates an error at the Wget side. (I guess this is a difference between SSL and plain TCP connections.) Wget assumes the transfer being incomplete and tries it again and again. Not really a bug, but also not the result a user would expect... Saying "the server is buggy" doesn't help either. Here is a debug output. $ ../src/wget -d --ca-certificate=ca-rsa-cert.pem --private-key=ca-rsa-key- plain.pem https://example.com:8443 Setting --ca-certificate (cacertificate) to ca-rsa-cert.pem Setting --private-key (privatekey) to ca-rsa-key-plain.pem DEBUG output created by Wget 1.15.11-8a34-dirty on linux-gnu. URI encoding = ‘UTF-8’ --2014-03-19 12:25:28-- https://example.com:8443/ Certificates loaded: 162 Resolving example.com (example.com)... 127.0.0.1 Caching example.com => 127.0.0.1 Connecting to example.com (example.com)|127.0.0.1|:8443... connected. Created socket 4. Releasing 0x0000000001724de0 (new refcount 1). ---request begin--- GET / HTTP/1.1 Accept: */* Host: example.com:8443 Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.0 200 ok Content-type: text/html ---response end--- 200 ok Registered socket 4 for persistent reuse. Length: unspecified [text/html] Saving to: ‘index.html.3’ [ <=> ] 5,116 --.-K/s in 0s Disabling further reuse of socket 4. A len=5116 contlen=-1 res=-1 B len=5116 contlen=-1 res=-1 2014-03-19 12:25:28 (136 MB/s) - Read error at byte 5116 (The TLS connection was non-properly terminated.).Retrying. --2014-03-19 12:25:29-- (try: 2) https://example.com:8443/ Found example.com in host_name_addresses_map (0x1724de0) Connecting to example.com (example.com)|127.0.0.1|:8443... connected. Created socket 4. Releasing 0x0000000001724de0 (new refcount 1). ---request begin--- GET / HTTP/1.1 Range: bytes=5116- Accept: */* Host: example.com:8443 Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.0 200 ok Content-type: text/html ---response end--- 200 ok Registered socket 4 for persistent reuse. Length: unspecified [text/html] Saving to: ‘index.html.3’ [ <=> ] 5,116 --.-K/s in 0s Disabling further reuse of socket 4. 2014-03-19 12:25:29 (1.31 GB/s) - Read error at byte 5116 (The TLS connection was non-properly terminated.).Retrying. ^C
