On Nov 1, 2011, at 7:54 PM, Father Chrysostomos wrote:
> Begin forwarded message:
>
>> From: Father Chrysostomos <sprout cpan.org>
>> Date: November 1, 2011 7:52:15 PM PDT
>> To: libwww perl.org
>> Subject: Support for HTTPS over proxies
>>
>> Currently LWP does not support HTTPS over proxies. I’m trying to write a
>> patch for just that, but I’m not sure whether the special-casing code should
>> go in LWP::UserAgent::send_request or in LWP::Protocol::http::request.
>>
>> If an HTTPS connection is made through an HTTP proxy, the request method
>> sent to the proxy must be CONNECT, followed by optional headers (probably
>> default_headers). Then the client must wait for an HTTP 200 response, after
>> which it must initiate an HTTPS request using the same connection.
>>
>> Should this sort of switching be in LWP::UserAgent::send_method?
>
> I mean send_request.
I’ve just discovered that Net::SSL supports proxies. So I’m satisfied. I’m
afraid a patch will not be forthcoming. However, I have to do this dance to
make things work properly:
require Net'SSL;
$Net::HTTPS'SSL_SOCKET_CLASS = 'Net::SSL';
require LWP::UserAgent;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
$ua = new LWP'UserAgent;
{
local $ENV{HTTPS_PROXY};
$ua->env_proxy;
}
It would be nice if it could be made easier some day.