Hello Folks!
Environment:
libwww-perl: 5.805 Crypt::SSLeay -- 0.51 OS: Solaris 8 Perl: 5.8.4
Issue Summary: Issue with SSL POST operation.
I have a script that randomly fails against devices using HTTPS example: I run the script 3 times aganst the same device and all works ok. Then the next 3 runs fail. Then the next run works. I receive these types of messages: StatusLine500 Server closed connection without sending any data back StatusLine500 EOF When the script is run on our old dev server using libwww-perl: 5.79; it seems to work everytime ok. However, it randomly fails when using libwww-perl: 5.803 or 5.805. Any suggestions on how to debug this? I would appreciate any feedback at all! :)
$ua = LWP::UserAgent->new; # create new user agent obje +ct $url = "$baseUrl$urlConfigFile"; # create URL for getting confi +g ascii file # set up HTTP REQUEST object $httpReq = HTTP::Request->new(POST=>$url) ; # init Request +object $httpReq-> content_type('application/x-www-form-urlencoded') ; $httpReq->content('DownloadFormat=ascii'); # pass form vari +ables $httpReq-> authorization_basic($UID, $upassw) ; # credentials $strReq = $httpReq->as_string( ); # debug dump of Request objec +t print "\nThe Request:\n$strReq\n"; print "\n\nNow get the WSD config ascii file.\n"; print "Submitting browser request using url [$url].\n"; $httpResp = $ua->request($httpReq) ; # launch request $statusLine = $httpResp->status_line(); $statusCode = $httpResp->code(); $statusMsg = $httpResp->message(); print "HTTP Response: StatusLine[$statusLine] Code[$statusCode] Messag +e[$statusMsg]\n"; if ($httpResp->is_success) { print "Request OK.\n"; } else { die "Request failed.\n"; } # ok, save content to file open(FILEO, ">$asciiFile") || die "Error $! Could not open file $ascii +File.\n"; print FILEO $httpResp->content; close(FILEO);
Example run:
./getwsd4.pl device-b 10.10.10.10 1900 admin admin Processing devName [device-b] ip addr [10.10.10.10]. Using libwww-perl-5.803 Output file is [/export/ieapps/local/test/device-b.asc]. Base URL [https://10.10.10.10:1900] The Request: POST https://10.10.10.10:1900/dynamic/File/Configuration/ReceivefromDe +vice Authorization: Basic ZG16c3VwcDpmaXNINHNAIWU= Content-Type: application/x-www-form-urlencoded DownloadFormat=ascii Now get the WSD config ascii file. Submitting browser request using url [https://10.10.10.10:1900/dynamic +/File/Configuration/ReceivefromDevice]. HTTP Response: StatusLine[500 EOF] Code[500] Message[EOF] Request failed.

In reply to libwww-SSL Post Issue by azstyx

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, details, 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, summary, 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.