Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.


by moritz (Cardinal)
on Apr 26, 2014 at 13:26 UTC ( #1083931=note: print w/replies, xml ) Need Help??

in reply to LWP and HTTPS

$ wget --2014-04-26 15:23:36-- +ecordSearch.jsp Resolving ( Connecting to (||:443... con +nected. OpenSSL: error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(100 +0) Unable to establish SSL connection. $ curl curl: (35) error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1 +000)

I'd argue that either server's SSL setup is broken, or that you need a trust client certificate. Perl won't help you here.

Replies are listed 'Best First'.
Re^2: LWP and HTTPS
by Gangabass (Vicar) on Apr 26, 2014 at 13:44 UTC
    I tried $ENV{HTTPS_VERSION} = 3; because curl -3 $URL is working but my Perl code still return same error :-(

      If you want to set up the environment, either do so outside your script, or at least, before the SSL modules are loaded:

      BEGIN { $ENV{ HTTPS_VERSION }= 3; }; use WWW::Mechanize;
        This will not work because $ENV{ HTTPS_VERSION }= 3; is the default value :-(
Re^2: LWP and HTTPS
by Gangabass (Vicar) on Apr 26, 2014 at 13:30 UTC
    But why it's working in the browser? How I can tell LWP to ignore this error?
      Yet another broken SSL server which cannot do TLS1.0 or better. Browsers work around this kind of error by retrying with a downgraded SSL version.
      Recent versions of LWP (base of WWW::Mechanize) use IO::Socket::SSL/Net::SSLeay by default and you can simply enforce a specific SSL version like this:
      $mech->ssl_opts( SSL_version => 'SSLv3');
      I've tested it and it works with this broken server.
        Brilliant!!! Thank you! But I still don't understand why $ENV{ HTTPS_VERSION }= 3 is not work but  SSL_version => 'SSLv3' works...

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1083931]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2023-12-04 10:14 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (25 votes). Check out past polls.