Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

LWP and SHA2

by dorko (Prior)
on Apr 26, 2015 at 18:46 UTC ( #1124777=perlquestion: print w/replies, xml ) Need Help??

dorko has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I've got several Perl programs that talk to a learning management system (LMS) used by about 50,000 users. The LMS has three environments, TEST, QA and PRODUCTION. From my desktop, I can talk to all three environments just fine. From the server that handles the management of the LMS, I can talk to PRODUCTION ok. The server can't talk to the TEST or QA environments.

I'm using LWP for all the communications. My desktop and server are at the same version of the LWP module (6.04 -- the current of LWP is 6.13).

This is the error I'm getting:

( '500 Can\'t connect to QA.server.example.com:443', \bless( { '_content' => '', '_uri' => bless( do{\(my $o = 'https://QA.server.exa +mple.com/)}, 'URI::https' ), '_headers' => bless( { 'user-agent' => 'Management P +rogram', 'authorization' => 'Bearer SU +PERPOWERFULLPASSWORDGOESHERE' }, 'HTTP::Headers' ), '_method' => 'GET' }, 'HTTP::Request' ), 'Can\'t connect to QA.server.example.com:443 LWP::Protocol::https::Socket: SSL connect attempt failed with unknown +error error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown +message digest algorithm at /opt/perl/lib/site_perl/5.16.1/LWP/Protoc +ol/http.pm line 51. ', \bless( { '_content' => 'Can\'t connect to QA.server.example.c +om:443 LWP::Protocol::https::Socket: SSL connect attempt failed with unknown +error error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown +message digest algorithm at /opt/perl/lib/site_perl/5.16.1/LWP/Protoc +ol/http.pm line 51. ', '_rc' => 500, '_headers' => bless( { 'client-warning' => 'Internal + response', 'client-date' => 'Sun, 26 Apr + 2015 18:18:56 GMT', 'content-type' => 'text/plain +', '::std_case' => { 'client-war +ning' => 'Client-Warning', 'client-dat +e' => 'Client-Date' } }, 'HTTP::Headers' ), '_msg' => 'Can\'t connect to QA.server.example.com/: +443', '_request' => ${$![1]} }, 'HTTP::Response' ) );

I pretty sure I know what's going on: The TEST and QA servers are using SHA2 / SHA256 SSL certificates. PRODUCTION is using SHA1. The OpenSSL on the server is 0.9.8y. Everything I've read says OpenSSL greater than 0.9.8o can handle SHA2.

My question is how do I fix this? Will upgrading LWP to 6.13 fix things? (I'm assuming the version of LWP I'm using was installed using an earlier version of OpensSSL than is currently installed.) How can I get LWP to work with SHA2? How can I get LWP to use the more recent version of OpensSSL?

Cheers,

Brent

-- Yup, I'm a Delt.

Replies are listed 'Best First'.
Re: LWP and SHA2
by Anonymous Monk on Apr 26, 2015 at 20:37 UTC
    always upgrade LWP dependencies ... reinstall then, reinstall IO::Socket::SSL
      Thanks for your time.

      Would that be something as simple as:

      > cpan install LWP::Bundle
      followed by:
      > cpan install IO::Socket::SSL
      Is that enough to get Perl using the installed copy of OpenSSL 0.9.8y ?

      UPDATE: IO::Socket::SSL version 1.90 "RT#85290, support more digest, especially SHA-2." is the fix I'm looking for.

      UPDATE: that's actually cpan install Bundle::LWP

      Cheers,

      Brent

      -- Yeah, I'm a Delt.
        In case anyone ever finds this looking for answers, did three things to get it working:
        1. I installed IO::Socket::SSL to a version greater than 1.90 (in fact version 2.012). (I just copied the source of that module to a file in a directory on the server.)
        2. I had to do the same with IO::Socket::SSL::PublicSuffix.
        3. I used a use lib qw( /path/to/module ) statement to get my program to load the right modules.

        I did not find it necessary to upgrade LWP. And I did have a version of OpenSSL installed that was greater than 0.9.8o. Cheers,

        Brent

        -- Yeah, I'm a Delt.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1124777]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2020-06-02 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (12 votes). Check out past polls.

    Notices?