Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Disable SSL certificate verification with LWP

by wrog (Friar)
on May 30, 2015 at 21:35 UTC ( [id://1128428]=note: print w/replies, xml ) Need Help??


in reply to Disable SSL certificate verification with LWP

You can actually specify to the underlying socket library how you want it to verify certificates or not. The problem is the options are different depending on what socket library you're using. But there's a way to force it to use a particular one, and then you know:
{ local $NET::HTTPS::SSL_SOCKET_CLASS = 'IO::Socket::SSL'; $ua = LWP::UserAgent->new(ssl_opts => \%ssl_options), }
and for %ssl_options, I'll let you look it up in the IO::Socket::SSL docs.

You could also make the setting of $NET::HTTPS::SSL_SOCKET_CLASS global if you don't have to play nice with other instances of LWP::UserAgent.

I'll note that I got burned on this when at one point I needed a particular setting (to exclude SSLv2 in favor of SSLv3 to deal with sites that immediately drop the connection if you so much as mention SSLv2) that got outdated a couple years later when SSLv3 was likewise declared anathema, the default settings of IO::Socket::SSL having caught up to what was needed to survive, I would have been better off without the explicit setting... meaning if you're going to do this stuff you're going to have to track it...)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1128428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found