LWP::Simple and SSL_verify_mode

12 views
Skip to first unread message

hymie!

unread,
Mar 22, 2021, 10:03:16 AMMar 22
to
So I've got this three line script:

#!/usr/bin/perl
use LWP::Simple;
my @lines = split(/\n/, get("https://sdo.gsfc.nasa.gov/"));

and it generates this error:

*******************************************************************
Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
possibly 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.
*******************************************************************
at /usr/lib64/perl5/LWP/Protocol/http.pm line 35.

Can somebody help me understand where/how I can set this variable in my
script? I don't see any reference in the LWP::Simple docs that talk
about setting options. Google has been no help.

Thanks.

--hymie!

Rainer Weikusat

unread,
Mar 22, 2021, 10:15:44 AMMar 22
to
hymie! <hy...@nasalinux.net> writes:
> So I've got this three line script:
>
> #!/usr/bin/perl
> use LWP::Simple;
> my @lines = split(/\n/, get("https://sdo.gsfc.nasa.gov/"));
>
> and it generates this error:
>
> *******************************************************************
> Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
> is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
> possibly 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.
> *******************************************************************
> at /usr/lib64/perl5/LWP/Protocol/http.pm line 35.
>
> Can somebody help me understand where/how I can set this variable in my
> script?

Seems to be[*] the ssl_opts attribute of LWP::UserAgent.

[*] I'm not using this module.

hymie!

unread,
Mar 22, 2021, 10:20:24 AMMar 22
to
In our last episode, the evil Dr. Lacto had captured our hero,
I'm not using LWP::UserAgent (at least, not directly). That's why I'm so
confused as to what the error message wants me to do.

--hymie!

Rainer Weikusat

unread,
Mar 22, 2021, 10:44:22 AMMar 22
to
LWP::Simple is a simplified wrapper around LWP::UserAgent.

Rainer Weikusat

unread,
Mar 22, 2021, 10:49:16 AMMar 22
to
LWP::Simple is a simplified wrapper around LWP::UserAgent. As it uses an
internal $ua object (file-scope my variable), you'll either need to stop
using it (possibly by copying from of the code) or use the
PERL_LWP_SSL_VERIFY_HOSTNAME (documented in LWP::UserAgent
documentation) to cause the attribute to be initialized to a suitable
value.

Reply all
Reply to author
Forward
0 new messages