Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hi All,

I have a vexing problem with Perl LWP and accessing an internal company HTTPS site.

I was having lots of problems getting an SSL handshake to work, and I finally got around that.

Then I was having problems with credentials not working, and I finally got around that.

Now I am having some kind of internal issue with HTTP. It seems like the SSL handshake is done, but I cannot pull data from the website after that. I just get this 500 internal error on the client side.

I am not sure what I can do to debug this issue - any ideas for things I need to look at? Thanks!

Here is the code I used (edited for posting)

use LWP::UserAgent; use LWP::Protocol::https; use HTTP::Request; use HTTP::Cookies; $IO::Socket::SSL::DEBUG=3; our $ua = LWP::UserAgent->new(keep_alive=>1); $ua->agent("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11 +.0) like Gecko"); $ua->ssl_opts(SSL_ca_file => 'C:\OpenSSL-Win32\cert\companyx Root CA B +ase64.cer'); $ua->ssl_opts(verify_hostname=>1); $ua->cookie_jar(HTTP::Cookies->new(file => "$ENV{HOME}/.cookies.txt")) +; $ENV{http_proxy} = ''; our $host = "cdis.companyx.com:9283"; our $url1 = "https://$host/cdis/default.asp"; $ua->credentials("$host",'', "AMR\\username", 'password'); $ua->timeout(10); my $response1 = $ua->get($url1); if ($response1->is_success) { print $response1->content; } else { print "Error: " . $response1->status_line . "\n"; print $response1->headers()->as_string(), "\n"; print $response1->content; } exit(0);

Here is the output

DEBUG: .../IO/Socket/SSL.pm:2633: new ctx 62187576 DEBUG: .../IO/Socket/SSL.pm:549: socket not yet connected DEBUG: .../IO/Socket/SSL.pm:551: socket connected DEBUG: .../IO/Socket/SSL.pm:573: ssl handshake not started DEBUG: .../IO/Socket/SSL.pm:606: using SNI with hostname cdis.companyx +.com DEBUG: .../IO/Socket/SSL.pm:641: request OCSP stapling DEBUG: .../IO/Socket/SSL.pm:660: set socket to non-blocking to enforce + timeout=10 DEBUG: .../IO/Socket/SSL.pm:676: Net::SSLeay::connect -> -1 DEBUG: .../IO/Socket/SSL.pm:686: ssl handshake in progress DEBUG: .../IO/Socket/SSL.pm:696: waiting for fd to become ready: SSL w +ants a read first DEBUG: .../IO/Socket/SSL.pm:716: socket ready, retrying connect DEBUG: .../IO/Socket/SSL.pm:2536: did not get stapled OCSP response DEBUG: .../IO/Socket/SSL.pm:2489: ok=1 cert=62234208 DEBUG: .../IO/Socket/SSL.pm:2489: ok=1 cert=62234544 DEBUG: .../IO/Socket/SSL.pm:2489: ok=1 cert=62234432 DEBUG: .../IO/Socket/SSL.pm:2489: ok=1 cert=62234320 DEBUG: .../IO/Socket/SSL.pm:1581: scheme=www cert=62234320 DEBUG: .../IO/Socket/SSL.pm:1591: identity=cdis.companyx.com cn=cdis.c +ompanyx.com alt=2 fm1seagwebpd01.amr.corp.companyx.com 2 fm1seagwebpd +02.amr.corp.companyx.com 2 fm1seagwebpd03.amr.corp.companyx.com 2 cdi +sprod-node1.companyx.com 2 cdisprod-node2.companyx.com 2 cdisprod-nod +e3.companyx.com 2 cdis.companyx.com DEBUG: .../IO/Socket/SSL.pm:676: Net::SSLeay::connect -> -1 DEBUG: .../IO/Socket/SSL.pm:686: ssl handshake in progress DEBUG: .../IO/Socket/SSL.pm:696: waiting for fd to become ready: SSL w +ants a read first DEBUG: .../IO/Socket/SSL.pm:716: socket ready, retrying connect DEBUG: .../IO/Socket/SSL.pm:676: Net::SSLeay::connect -> 1 DEBUG: .../IO/Socket/SSL.pm:731: ssl handshake done DEBUG: .../IO/Socket/SSL.pm:2666: free ctx 62187576 open=62187576 DEBUG: .../IO/Socket/SSL.pm:2671: free ctx 62187576 callback DEBUG: .../IO/Socket/SSL.pm:2678: OK free ctx 62187576 Error: 500 Status read failed: Unknown error Content-Type: text/plain Client-Date: Tue, 12 May 2015 15:19:46 GMT Client-Warning: Internal response Status read failed: Unknown error at C:/Perl/site/lib/Net/HTTP/Methods +.pm line 276.

In reply to Help with LWP & SSL 500 Internal response error by dcsastry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (4)
    As of 2020-10-22 22:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favourite web site is:












      Results (230 votes). Check out past polls.

      Notices?