Skip Menu |

This queue is for tickets about the Crypt-SSLeay CPAN distribution.

Report information
The Basics
Id: 79884
Status: resolved
Priority: 0/
Queue: Crypt-SSLeay

People
Owner: nanis [...] runu.moc.invalid
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: PKCS12 support with LWP 6.x
I'm having difficulty getting a PKCS12 certificate to work using new LWP (6.x)... throwing out a lifeline here in case you folks can offer a suggestion. Basically, this code works under perl5.8.8 and old Crypt::SSLeay (version 0.57) and LWP (version 5.826): local $ENV{HTTPS_PKCS12_PASSWORD} = $sslPassword; local $ENV{HTTPS_PKCS12_FILE} = $pkcs12_cert; my $response = LWP::UserAgent->new->request(POST($url, Content => $content)); ...but does not under perl5.14.2 and latest versions of Crypt::SSLeay 0.64) and LWP (6.03). I understand that much ssl-related code has changed in LWP lately; is P12 support known to still work? Should I be setting different variables/options in order to get the certificate and password to be picked up? I've also tried passing this to LWP::UserAgent->new with no luck: ssl_opts => { SSL_use_cert => 1, SSL_cert_file => $pkcs12_cert, SSL_passwd_cb => sub { $sslPassword }, } thanks very much for any direction at all you can provide. (also just posted to http://stackoverflow.com/questions/12627577/pkcs12-ssl-certificate-is-not-being-recognized )
I've managed to get a connection working with a PEM certificate, as described in more detail in the stackoverflow thread. Does Crypt::SSLeay only come into play for pre-6.0 LWP? If so, it would be useful to explain this in the docs, and provide a reference to IO::Socket::SSL, which *is* used with LWP 6.x. thanks guys!
Apologies for the really late response to this. Here is an explanation for the record. LWP 6.02 unbundled HTTPS support to LWP::Protocol::https which pulls in IO::Socket::SSL. Unless specifically overridde, LWP::UserAgent then uses IO::Socket::SSL for the plumbing. To force LWP::UserAgent to use Net::SSL (and therefore Crypt::SSLeay), you can use one of the following use Net::HTTPS; $Net::HTTPS::SSL_SOCKET_CLASS = 'Net::SSL'; or local $ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = 'Net::SSL'; or use Net::SSL; before loading LWP::UserAgent (or any other module that uses it). HTH, -- Sinan On Thu Sep 27 15:22:04 2012, ETHER wrote: Show quoted text
> I've managed to get a connection working with a PEM certificate, as > described in more detail in the stackoverflow thread. > > Does Crypt::SSLeay only come into play for pre-6.0 LWP? If so, it would > be useful to explain this in the docs, and provide a reference to > IO::Socket::SSL, which *is* used with LWP 6.x. > > thanks guys!