Scripts broke after upgrading LWP “certificate verify failed”

前端 未结 4 996
一整个雨季
一整个雨季 2021-01-07 20:11

I have a lot of scripts, most of them based around WWW::Mechanize that scrape data off of misc hardware that is accessible via HTTPs. After upgrading most of my

4条回答
  •  醉酒成梦
    2021-01-07 20:39

    For me, using:

    my $ua = LWP::UserAgent->new(
      ssl_opts => { verify_hostname => 0 },
    );
    

    Yielded

    Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER together with SSL_ca_file|SSL_ca_path for verification. If you really don't want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.

    Using this did not give any warnings:

    my $ua = LWP::UserAgent->new(
      ssl_opts => { SSL_verify_mode => 'SSL_VERIFY_NONE'},
    );
    

提交回复
热议问题