chacham has asked for the wisdom of the Perl Monks concerning the following question:
Strawberry Perl 5.18.2/Windows 7
WWW::Mechanize or LWP::UserAgent behind a corporate firewall (no login required)
Connect via http works.
Connect via https results in an error
Sites tried: example.com, google.com, and slashdot.org.
Example code:
use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->proxy(['http', 'https'], 'http://xx.xx.x.xx:xx'); print $mech->get("https://example.com");
Result from http: HTTP::Response=HASH(0x34001f0)
Result from https: Error GETing https://example.com: Server closed connection without sending any data back at <filename> line 4.
use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->proxy(['http', 'https'], 'http://xx.xx.x.xx:xx'); print $ua->get("https://example.com");
Result from http: HTTP::Response=HASH(0x2ef6bf8)
Result from https: Server closed connection without sending any data back at C:/strawberry/perl/vendor/lib/Net/HTTP/Methods.pm line 373.
(FWIW, line 373 is die() in sub read_response_headers.)
Please help me determine the cause of the error and to connect via https.
Update
"Server closed connection without sending any data back" means the proxy server. This is easily seen via telnet to the proxy server:
GET http://example.com/ HTTP/1.1 (2 newlines)returns the page.
GET https://example.com/ HTTP/1.1 (2 newlines)closes the connection.
rt://1894 Workarounds listed there.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP/HTTPS/Proxy error: Server closed connection without sending any data back
by Corion (Patriarch) on Apr 30, 2014 at 13:49 UTC | |
by chacham (Prior) on Apr 30, 2014 at 14:14 UTC |