LWP::UserAgent causes SSL fails even though SSL checking is disabled?

I know about LWP::UserAgent insists on verifying hostname, but as I already use the option in the accepted answer, I think this must be a different issue.

I have some perl code using LWP::UserAgent to download some pages (and do stuff with them), but I have a problem with some sites using certain certificates, that LWP::UserAgent finds bad. The security SSL offers doesn't matter to this usage, so I've added an option to my script allowing me to disable the SSL checks when I encounter such sites. Unfortunately it seems what I do is not enough.

Below is a minimal (I think, it's pretty small anyway) "script" (4 statements passed in with -e) + output, showing the problem (edited not to reveal the site that apparent has questionable security):

> perl -MData::Dumper -MLWP::UserAgent -e '$ua = LWP::UserAgent->new(); $ua->ssl_opts('verify_hostname' => 0, SSL_verify_mode => 0); $r = $ua->get("https://....com/p/index.php"); print Dumper($r),'
$VAR1 = bless( {
                 '_msg' => 'Can\'t connect to .....com:443 (SSL connect attempt failed error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small)',
                 '_content' => 'Can\'t connect to ....com:443 (SSL connect attempt failed error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small)

SSL connect attempt failed error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small at /usr/share/perl5/LWP/Protocol/http.pm line 50.
',
                 '_request' => bless( {
                                        '_headers' => bless( {
                                                               'user-agent' => 'libwww-perl/6.36'
                                                             }, 'HTTP::Headers' ),
                                        '_uri' => bless( do{\(my $o = 'https://....com/p/index.php')}, 'URI::https' ),
                                        '_method' => 'GET',
                                        '_content' => ''
                                      }, 'HTTP::Request' ),
                 '_rc' => 500,
                 '_headers' => bless( {
                                        'client-date' => 'Fri, 13 Mar 2020 21:03:39 GMT',
                                        '::std_case' => {
                                                          'client-warning' => 'Client-Warning',
                                                          'client-date' => 'Client-Date'
                                                        },
                                        'content-type' => 'text/plain',
                                        'client-warning' => 'Internal response'
                                      }, 'HTTP::Headers' )
               }, 'HTTP::Response' );

What is wrong, and can I get the page downloaded?

Upvotes: 0

Views: 231

Answers (0)

Related Questions