danny0085 has asked for the wisdom of the Perl Monks concerning the following question:
At which I get back a response from the proxy server that says:$PROXY_IP = "proxy.mydomain.com:8080"; $ua = LWP::UserAgent->new; $ua->proxy(['http', 'https'], "http://$PROXY_IP/"); $URL = "https://www.somedomain.com/index.htm"; $request = HTTP::Request->new('GET', "$URL"); $response = $ua->request($request);
I have read that LWP don't support HTTPS over proxy properly and needs a patch. I hope someone can help me. Thanks SOLVED:"Unsupported Request Method and Protocol"
use Net::SSL (); # From Crypt-SSLeay use LWP::UserAgent; $Net::HTTPS::SSL_SOCKET_CLASS = "Net::SSL"; # Force use of Net::SSL $ENV{HTTPS_PROXY} = 'http://98.142.214.160:443'; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new('GET','https://twitter.com'); my $res = $ua->request($req); print $res->status_line;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP patch (https through a proxy)
by zentara (Cardinal) on Sep 19, 2012 at 15:30 UTC | |
|
Re: LWP patch (https through a proxy)
by Anonymous Monk on Sep 19, 2012 at 18:48 UTC |