I've created a libnet-ssleay-perl package from version 18.6_6 but it still hangs.

If someone wants to review my work it's here:

On the other hand, I hacked around in file /usr/share/perl5/LWP/Protocol/http.pm. And, things seems to be working better/ok when I move the

"if (defined($wbits) && $wbits =~ /[^\0]/) {...}

block before the

"if (defined($rbits) && $rbits =~ /[^\0]/) {...}

block around line 368: LWP::UserAgent->new->post returns the same $response in the debuger when called with or without 'ssl_opts => { SSL_version => "TLSv1_2"}' (though it doesn't return exactly the same output on the terminal).

Here's the logs of y debug sessions:

root@vm-cyrille-debian:~# perl -d -MLWP::UserAgent -e 'LWP::UserAgent->new->post("https://facebook.com";, { data => "foo" }) or die'

Loading DB routines from perl5db.pl version 1.53
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::(-e:1): LWP::UserAgent->new->post("https://facebook.com";, { data => "foo" }) or die
  DB<1> s
LWP::UserAgent::new(/usr/share/perl5/LWP/UserAgent.pm:23):
23: Carp::croak("Options to LWP::UserAgent should be key/value pairs, not hash reference")
24:             if ref($_[1]) eq 'HASH';
  DB<1> c 354
LWP::UserAgent::request(/usr/share/perl5/LWP/UserAgent.pm:354):
354:                $referral_uri
355: = $HTTP::URI_CLASS->new($referral_uri, $base)->abs($base);
  DB<2> r
scalar context return from LWP::UserAgent::request: '_content' => ''
'_headers' => HTTP::Headers=HASH(0x557e79365db8)
   '::std_case' => HASH(0x557e79c76b60)
      'base' => 'Base'
      'client-date' => 'Client-Date'
      'client-peer' => 'Client-Peer'
      'client-response-num' => 'Client-Response-Num'
      'client-ssl-cert-issuer' => 'Client-SSL-Cert-Issuer'
      'client-ssl-cert-subject' => 'Client-SSL-Cert-Subject'
      'client-ssl-cipher' => 'Client-SSL-Cipher'
      'client-ssl-socket-class' => 'Client-SSL-Socket-Class'
      'content-base' => 'Content-Base'
      'strict-transport-security' => 'Strict-Transport-Security'
      'x-fb-debug' => 'X-FB-Debug'
   'client-date' => 'Thu, 13 Dec 2018 14:08:18 GMT'
   'client-peer' => '2a03:2880:f121:83:face:b00c:0:25de:443'
   'client-response-num' => 1
'client-ssl-cert-issuer' => '/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA' 'client-ssl-cert-subject' => '/C=US/ST=California/L=Menlo Park/O=Facebook, Inc./CN=*.facebook.com'
   'client-ssl-cipher' => 'TLS_AES_128_GCM_SHA256'
   'client-ssl-socket-class' => 'IO::Socket::SSL'
   'connection' => 'close'
   'content-length' => 0
   'content-type' => 'text/html; charset="utf-8"'
   'date' => 'Thu, 13 Dec 2018 14:08:18 GMT'
   'location' => 'https://www.facebook.com/'
   'strict-transport-security' => 'max-age=15552000; preload'
'x-fb-debug' => '8/YGQji4f2aNK/44bYckExpyyIg8M5ODr1Ue9sTZ3zzHf/BGgVhS4q5sp7yZSpyaaXC8D4ERoL0UeunhTO8CeA=='
'_msg' => 'Moved Permanently'
'_protocol' => 'HTTP/1.1'
'_rc' => 301
'_request' => HTTP::Request=HASH(0x557e78f7c970)
   '_content' => 'data=foo'
   '_headers' => HTTP::Headers=HASH(0x557e78f7c958)
      '::std_case' => HASH(0x557e78ff95b0)
         'if-ssl-cert-subject' => 'If-SSL-Cert-Subject'
      'content-length' => 8
      'content-type' => 'application/x-www-form-urlencoded'
      'user-agent' => 'libwww-perl/6.36'
   '_method' => 'POST'
   '_uri' => URI::https=SCALAR(0x557e78afe8f0)
      -> 'https://facebook.com'
   '_uri_canonical' => URI::https=SCALAR(0x557e78dde770)
      -> 'https://facebook.com/'
Debugged program terminated.  Use q to quit or R to restart,
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
  DB<2>

and

root@vm-cyrille-debian:~# perl -d -MLWP::UserAgent -le 'print LWP::UserAgent->new(ssl_opts => { SSL_version => "TLSv1_2"})->post("https://facebook.com";, { data => "foo" })->message or die'

Loading DB routines from perl5db.pl version 1.53
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::(-e:1): print LWP::UserAgent->new(ssl_opts => { SSL_version => "TLSv1_2"})->post("https://facebook.com";, { data => "foo" })->message or die
  DB<1> s
LWP::UserAgent::new(/usr/share/perl5/LWP/UserAgent.pm:23):
23: Carp::croak("Options to LWP::UserAgent should be key/value pairs, not hash reference")
24:             if ref($_[1]) eq 'HASH';
  DB<2> c 354
LWP::UserAgent::request(/usr/share/perl5/LWP/UserAgent.pm:354):
354:                $referral_uri
355: = $HTTP::URI_CLASS->new($referral_uri, $base)->abs($base);
  DB<3> r
scalar context return from LWP::UserAgent::request: '_content' => ''
'_headers' => HTTP::Headers=HASH(0x55aa65669cb8)
   '::std_case' => HASH(0x55aa66253760)
      'base' => 'Base'
      'client-date' => 'Client-Date'
      'client-peer' => 'Client-Peer'
      'client-response-num' => 'Client-Response-Num'
      'client-ssl-cert-issuer' => 'Client-SSL-Cert-Issuer'
      'client-ssl-cert-subject' => 'Client-SSL-Cert-Subject'
      'client-ssl-cipher' => 'Client-SSL-Cipher'
      'client-ssl-socket-class' => 'Client-SSL-Socket-Class'
      'content-base' => 'Content-Base'
      'strict-transport-security' => 'Strict-Transport-Security'
      'x-fb-debug' => 'X-FB-Debug'
   'client-date' => 'Thu, 13 Dec 2018 14:09:16 GMT'
   'client-peer' => '2a03:2880:f121:83:face:b00c:0:25de:443'
   'client-response-num' => 1
'client-ssl-cert-issuer' => '/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA' 'client-ssl-cert-subject' => '/C=US/ST=California/L=Menlo Park/O=Facebook, Inc./CN=*.facebook.com'
   'client-ssl-cipher' => 'ECDHE-ECDSA-AES128-GCM-SHA256'
   'client-ssl-socket-class' => 'IO::Socket::SSL'
   'connection' => 'close'
   'content-length' => 0
   'content-type' => 'text/html; charset="utf-8"'
   'date' => 'Thu, 13 Dec 2018 14:09:16 GMT'
   'location' => 'https://www.facebook.com/'
   'strict-transport-security' => 'max-age=15552000; preload'
'x-fb-debug' => 'usg0Q4B5n06g7iSaDrAGUVyLwOQB7UUSPAQnITIjN0pMLcURXjF/aasKTyjyxUs7B3ja4N1bm8tdl1XSFDQR9g=='
'_msg' => 'Moved Permanently'
'_protocol' => 'HTTP/1.1'
'_rc' => 301
'_request' => HTTP::Request=HASH(0x55aa65559f00)
   '_content' => 'data=foo'
   '_headers' => HTTP::Headers=HASH(0x55aa65559ee8)
      '::std_case' => HASH(0x55aa655d4e60)
         'if-ssl-cert-subject' => 'If-SSL-Cert-Subject'
      'content-length' => 8
      'content-type' => 'application/x-www-form-urlencoded'
      'user-agent' => 'libwww-perl/6.36'
   '_method' => 'POST'
   '_uri' => URI::https=SCALAR(0x55aa650da278)
      -> 'https://facebook.com'
   '_uri_canonical' => URI::https=SCALAR(0x55aa65931110)
      -> 'https://facebook.com/'
HTTP::Response::message(/usr/share/perl5/HTTP/Response.pm:68):
68:     sub message   { shift->_elem('_msg',     @_); }
  DB<3>

Reply via email to