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...)


In reply to Re: Disable SSL certificate verification with LWP by wrog
in thread Disable SSL certificate verification with LWP by tunafish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.