Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: LWP HTTPS POST returns 500 EOF

by dominix (Deacon)
on Feb 25, 2004 at 01:36 UTC ( [id://331572]=note: print w/replies, xml ) Need Help??


in reply to LWP HTTPS POST returns 500 EOF

well ...
from a tcp/ip point of view I got this:
telnet login1.swipnet.se 443 Trying 130.244.199.102... telnet: Unable to connect to remote host: Network is unreachable
which elude a lot of trouble-shooting ...
but if this server is accessible for you, you may try to add this code
push @{ $ua->requests_redirectable }, 'POST';
this will allow the POST to be redirected, and could save you some more troubleshoot.
--
dominix

Replies are listed 'Best First'.
Re: Re: LWP HTTPS POST returns 500 EOF
by epljsod (Initiate) on Feb 25, 2004 at 22:22 UTC
    Hi dominix,
    first of all, thank you for your response! I tried the requests_redirectable, but unfortunately it did not help.

    I am able to connect with telnet login1.swipnet.se 443, but I do not know what to write once connected :-) Please enlight me how to perform trouble shooting with telnet.

    I attach some more debug information that I am able to retreive when using cgi scripts and redirecting the LWP request and the IE request to the dumping cgi scripts. I used normal HTTP, since I can not get HTTPS working with my webserver (not put any effort on it)
    Do you know any other way to retreive debug information, such as headers? I have in some posts seen more extensive information but I am not able to acquire it.
    Best regards
    /Johan

    From LWP client:
    BASH=/bin/sh BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i3 +86-redhat-linux-gnu") BASH_VERSION='2.05b.0(1)-release' CONTENT_LENGTH=47 CONTENT_TYPE=application/x-www-form-urlencoded DIRSTACK=() DOCUMENT_ROOT=/var/www/html EUID=48 GATEWAY_INTERFACE=CGI/1.1 GROUPS=() HOSTNAME=aca80065.ipt.aol.com HOSTTYPE=i386 HTTP_CONNECTION='TE, close' HTTP_HOST=xxxx.yyyy.org HTTP_TE='deflate,gzip;q=0.3' HTTP_USER_AGENT='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)' IFS=' ' MACHTYPE=i386-redhat-linux-gnu OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin PIPESTATUS=([0]="0") POSIXLY_CORRECT=y PPID=6272 PS4='+ ' PWD=/var/www/cgi-bin QUERY_STRING= REMOTE_ADDR=213.100.xxx.yyy REMOTE_PORT=63500 REQUEST_METHOD=POST REQUEST_URI=/cgi-bin/print2.cgi SCRIPT_FILENAME=/var/www/cgi-bin/print2.cgi SCRIPT_NAME=/cgi-bin/print2.cgi SERVER_ADDR=172.168.0.101 SERVER_ADMIN=root@localhost SERVER_NAME=xxxx.zzzz.org SERVER_PORT=80 SERVER_PROTOCOL=HTTP/1.1 SERVER_SIGNATURE='<address>Apache/2.0.40 Server at xxxx.yyyy.org Port +80</address> ' SERVER_SOFTWARE='Apache/2.0.40 (Red Hat Linux)' SHELL=/sbin/nologin SHELLOPTS=braceexpand:hashall:interactive-comments:posix SHLVL=1 TERM=dumb UID=48 UNIQUE_ID=mwym9qyoAGUAABiAVDMAAAAB _=echo


    From IE client:
    BASH=/bin/sh BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i3 +86-redhat-linux-gnu") BASH_VERSION='2.05b.0(1)-release' CONTENT_LENGTH=47 CONTENT_TYPE=application/x-www-form-urlencoded DIRSTACK=() DOCUMENT_ROOT=/var/www/html EUID=48 GATEWAY_INTERFACE=CGI/1.1 GROUPS=() HOSTNAME=aca80065.ipt.aol.com HOSTTYPE=i386 HTTP_ACCEPT='image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, appl +ication/x-shockwave-flash, */*' HTTP_ACCEPT_ENCODING='gzip, deflate' HTTP_ACCEPT_LANGUAGE=sv HTTP_CACHE_CONTROL=no-cache HTTP_CONNECTION=Keep-Alive HTTP_HOST=xxxx.yyyy.org HTTP_USER_AGENT='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)' IFS=' ' MACHTYPE=i386-redhat-linux-gnu OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin PIPESTATUS=([0]="0") POSIXLY_CORRECT=y PPID=27245 PS4='+ ' PWD=/var/www/cgi-bin QUERY_STRING= REMOTE_ADDR=213.100.xxx.yyy REMOTE_PORT=63502 REQUEST_METHOD=POST REQUEST_URI=/cgi-bin/print2.cgi SCRIPT_FILENAME=/var/www/cgi-bin/print2.cgi SCRIPT_NAME=/cgi-bin/print2.cgi SERVER_ADDR=172.168.0.101 SERVER_ADMIN=root@localhost SERVER_NAME=xxxx.yyyy.org SERVER_PORT=80 SERVER_PROTOCOL=HTTP/1.1 SERVER_SIGNATURE='<address>Apache/2.0.40 Server at xxxx.yyyy.org Port +80</address> ' SERVER_SOFTWARE='Apache/2.0.40 (Red Hat Linux)' SHELL=/sbin/nologin SHELLOPTS=braceexpand:hashall:interactive-comments:posix SHLVL=1 TERM=dumb UID=48 UNIQUE_ID=paMUoqyoAGUAAGpttEYAAAAK _=echo
      the telnet example was to show that there were a connection problem. for me the server is (still) not responding, but anyway, if you want to test some connection over ssl you need no telnet but openssl and type something like :
      openssl s_client -connect login1.swipnet.se:443 POST /login.php username=xxxxxxxxxx;password=yyyyyy;
      note the CR/LF at the end.
      I recommend you read more about HTTP if you need to debug such transaction, the next step in debugging is to use a proxy that will do the encryption and you can sniff what happend between your client machine and the proxy , quite tricky anyway.
      --
      dominix
        I think that it is not accepted to connect to the server from outside of the local network, probably a security issue.
        Anyway, I am able to connect with openssl and the server responds with following:
        [johan@aca80065 ~]$ openssl s_client -connect login1.swipnet.se:443 CONNECTED(00000003) Pdepth=0 /C=SE/ST=Stockholm/L=Kista/O=Tele2 Sverige AB/CN=login1.swipn +et.se/emailAddress=staff@swip.net verify error:num=20:unable to get local issuer certificate verify return:1 depth=0 /C=SE/ST=Stockholm/L=Kista/O=Tele2 Sverige AB/CN=login1.swipne +t.se/emailAddress=staff@swip.net verify error:num=27:certificate not trusted verify return:1 depth=0 /C=SE/ST=Stockholm/L=Kista/O=Tele2 Sverige AB/CN=login1.swipne +t.se/emailAddress=staff@swip.net verify error:num=21:unable to verify the first certificate verify return:1 634:error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block t +ype is not 01:rsa_pk1.c:100: 634:error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check f +ailed:rsa_eay.c:464: 634:error:1408D07B:SSL routines:SSL3_GET_KEY_EXCHANGE:bad signature:s3 +_clnt.c:1185: [johan@aca80065 ~]$ POST /login.php Please enter content (application/x-www-form-urlencoded) to be POSTed: username=aahha;password=errr;
        My problem (quite embarrassing) is the same as when I tried to use lwp-request. When the server asks for content and I enter it, I am unable to finish (send) the content(username and password). I have pressed Enter after the input line.

        Best regards
        /Johan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://331572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-25 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found