Is it possible to handle the ssl connection with IO::Socket::SSL directly but still have all the LWP::UserAgent functionality for my interaction with the server after the connection is established?No, LWP wants to have full control over the socket and does not allow to create a connection using an already established socket. Apart from that, the following code works for me with LWP::UserAgent 6.05 and LWP::Protocol::https 6.04 (with the modification done in Ubuntu 14.04):
In this case s_server is started with -WWW, that is:use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->ssl_opts( SSL_ca_file => 'self-signed.pem'); # set verification name explicitly for this test because the # URL does not contain the correct name $ua->ssl_opts( SSL_verfifycn_name => 'foo.bar'); my $res = $ua->get('https://127.0.0.1:4433'); print $res->as_string;
Which leaves the question about the version of LWP::UserAgent and LWP::Protocol::https you are using.openssl s_server -cert self-signed.pem -key self-signed.pem -WWW
In reply to Re^3: HTTPS connection with LWP and self-signed certificate
by noxxi
in thread HTTPS connection with LWP and self-signed certificate
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |