payyans has asked for the wisdom of the Perl Monks concerning the following question:

I was trying to use POST method(form submission of username/password) on a 'https' authentication URL, and I get Error Occurred,500 unexpected EOF before status line seen.

When I enter wrong username/password, it comes up with the page saying "you entered wrong username/password". When the username/password are correct I get the error...

From the browser it works fine..

I have Crypt & OpenSSL installed in my machine and I put cookie jar & time out as well in my code.

Following are the things I get when I use LWP::Debug '+'
=========================================

LWP::Protocol::http::request: POST /xyz.form HTTP/1.0 Host: www.abcdxyz.com User-Agent: Mozilla/4.61 [en] (WinNT; U) libwww-perl/5.48 Content-Length: 60 Content-Type: application/x-www-form-urlencoded Allowed: GET HEAD PUT LWP::Protocol::http::request: POST /xyz.form HTTP/1.0 Host: www.abcdxyz.com User-Agent: Mozilla/4.61 [en] (WinNT; U) libwww-perl/5.48 Content-Length: 60 Content-Type: application/x-www-form-urlencoded Allowed: GET HEAD PUT 500 (Internal Server Error) unexpected EOF before status line seen Client-Date: Fri, 12 Jul 2002 02:17:34 GMT An Error Occurred 500 unexpected EOF before status line seen

=========================================
Can any one help me in this regard. Your help is really appreciated.

Replies are listed 'Best First'.
Re: LWP/HTTPS Error: 500 unexpected EOF before status line seen
by hossman (Prior) on Jul 12, 2002 at 04:21 UTC
    A 500 Error is (as it says) an "Internal Server Error" ... there isn't neccessarily anything wrong with your client.

    In situations like this, where it "works from a browser" the server side application is typically epecting some subtle behavior from a particular web browser (ie: a certain User-Agent)

    • Do you get the same results when you try to retrieve a static HTML page from the same server using SSL/HTTP-Auth ?
    • Do you have access to the server logs to see what it's logging when you try to hit it from your script?
    • do you have access to the source of whatever server based application you are loading?
      Do you get the same results when you try to retrieve a static HTML page from the same server using SSL/HTTP-Auth ?
      No, I can retrieve a static page without any problem(I tried the login page. Do you have access to the server logs to see what it's logging when you try to hit it from your script?
      No, unfortunately I don't have access do you have access to the source of whatever server based application you are loading?
      No, but I know it is an asp based application.


      Following is the source of the HTML
      <FORM name="frmLogin" METHOD=POST ACTION="/abclogin.form" onsubmit="re +turn(doSubmit());"> <td align=left><INPUT TYPE=TEXT NAME="usernm" VALUE="" MAXLENGTH=128 S +IZE=7></td> </tr> <tr> <th align=right>PIN:</th> <td align=left><INPUT TYPE=password NAME="pswd" VALUE="" MAXLENGTH=128 + SIZE=12> </td> </tr> <tr> <td align=center colspan=2><INPUT TYPE=submit NAME="buttonSubmit" VALU +E=" OK "onClick="if (checkCookiesAtField(username)) return true; el +se return false;"></td> </tr>
      Following is my code which do the POST, can u check anything wrong in it,
      $auth_url = "https://www.auth-abc.com/abclogin.form"; my $request = POST $auth_url, [ 'usernm' => 'myname', 'pswd' => 'mypassword', 'buttonSubmit' => ' OK ' ];