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

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-16 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found