Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: LWP HTTPS POST returns 500 EOF

by dominix (Deacon)
on Feb 27, 2004 at 12:04 UTC ( [id://332234]=note: print w/replies, xml ) Need Help??


in reply to LWP HTTPS POST returns 500 EOF

sounds weird, did you try with curl ? just to know ?
--
dominix

Replies are listed 'Best First'.
Re: Re: LWP HTTPS POST returns 500 EOF
by epljsod (Initiate) on Feb 27, 2004 at 21:14 UTC
    Hi again dominix!
    Finally, I think we have a little breakthrough. I laborated a bit with curl (never heard of it before) and when I issued the following command line it was able to correctly log in :)
    [johan@aca80065 ~]$ curl -d 'username=xxxx' -d 'password=yyyyy' -2 htt +ps://login1.swipnet.se/login.php
    However, I am still very interested to know why it does not work with LWP, since I think I still prefer to use LWP. Does this information give you any clues of what the problem might be using LWP ?

    Here is a log of the sent data (headers) with curl
    [root@aca80065 johan]# less log.txt == Info: About to connect() to login1.swipnet.se:443 == Info: Connected to login1.swipnet.se (130.244.199.102) port 443 == Info: SSL connection using DES-CBC3-MD5 == Info: Server certificate: == Info: subject: /C=SE/ST=Stockholm/L=Kista/O=Tele2 Sverige A +B/CN=login1.swipnet.se/emailA ddress=staff@swip.net == Info: start date: 2002-03-14 15:23:52 GMT == Info: expire date: 2004-03-13 15:23:52 GMT == Info: common name: login1.swipnet.se (matched) == Info: issuer: /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Co +nsulting cc/OU=Certification Services Division/CN=Thawte Server CA/emailAddress=server-certs@thawte +.com => Send header, 334 bytes (0x14e) 0000: 50 4f 53 54 20 2f 6c 6f 67 69 6e 2e 70 68 70 20 POST /login.php 0010: 48 54 54 50 2f 31 2e 31 0d 0a 55 73 65 72 2d 41 HTTP/1.1..User-A 0020: 67 65 6e 74 3a 20 63 75 72 6c 2f 37 2e 39 2e 38 gent: curl/7.9.8 0030: 20 28 69 33 38 36 2d 72 65 64 68 61 74 2d 6c 69 (i386-redhat-li 0040: 6e 75 78 2d 67 6e 75 29 20 6c 69 62 63 75 72 6c nux-gnu) libcurl 0050: 20 37 2e 39 2e 38 20 28 4f 70 65 6e 53 53 4c 20 7.9.8 (OpenSSL 0060: 30 2e 39 2e 37 61 29 20 28 69 70 76 36 20 65 6e 0.9.7a) (ipv6 en 0070: 61 62 6c 65 64 29 0d 0a 48 6f 73 74 3a 20 6c 6f abled)..Host: lo 0080: 67 69 6e 31 2e 73 77 69 70 6e 65 74 2e 73 65 0d gin1.swipnet.se. 0090: 0a 50 72 61 67 6d 61 3a 20 6e 6f 2d 63 61 63 68 .Pragma: no-cach 00a0: 65 0d 0a 41 63 63 65 70 74 3a 20 69 6d 61 67 65 e..Accept: image 00b0: 2f 67 69 66 2c 20 69 6d 61 67 65 2f 78 2d 78 62 /gif, image/x-xb 00c0: 69 74 6d 61 70 2c 20 69 6d 61 67 65 2f 6a 70 65 itmap, image/jpe 00d0: 67 2c 20 69 6d 61 67 65 2f 70 6a 70 65 67 2c 20 g, image/pjpeg, 00e0: 2a 2f 2a 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e */*..Content-Len 00f0: 67 74 68 3a 20 33 34 0d 0a 43 6f 6e 74 65 6e 74 gth: 34..Content 0100: 2d 54 79 70 65 3a 20 61 70 70 6c 69 63 61 74 69 -Type: applicati 0110: 6f 6e 2f 78 2d 77 77 77 2d 66 6f 72 6d 2d 75 72 on/x-www-form-ur 0120: 6c 65 6e 63 6f 64 65 64 0d 0a 0d 0a 75 73 65 72 lencoded....user 0130: 6e 61 6d 65 3d 6b 2d 35 31 38 37 36 26 70 61 73 name=xxxx&pas 0140: 73 77 6f 72 64 3d 35 65 52 2d 6f 52 2d 75 sword=yyyyy <= Recv header, 17 bytes (0x11) 0000: 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d HTTP/1.1 200 OK. 0010: 0a . <= Recv header, 37 bytes (0x25) 0000: 44 61 74 65 3a 20 46 72 69 2c 20 32 37 20 46 65 Date: Fri, 27 Fe 0010: 62 20 32 30 30 34 20 32 30 3a 35 38 3a 34 34 20 b 2004 20:58:44 0020: 47 4d 54 0d 0a GMT.. <= Recv header, 70 bytes (0x46) 0000: 53 65 72 76 65 72 3a 20 41 70 61 63 68 65 2f 31 Server: Apache/1 0010: 2e 33 2e 32 38 20 28 55 6e 69 78 29 20 50 48 50 .3.28 (Unix) PHP 0020: 2f 34 2e 33 2e 32 20 6d 6f 64 5f 73 73 6c 2f 32 /4.3.2 mod_ssl/2 0030: 2e 38 2e 31 35 20 4f 70 65 6e 53 53 4c 2f 30 2e .8.15 OpenSSL/0. 0040: 39 2e 36 69 0d 0a 9.6i.. <= Recv header, 25 bytes (0x19) 0000: 58 2d 50 6f 77 65 72 65 64 2d 42 79 3a 20 50 48 X-Powered-By: PH 0010: 50 2f 34 2e 33 2e 32 0d 0a P/4.3.2.. <= Recv header, 28 bytes (0x1c) 0000: 54 72 61 6e 73 66 65 72 2d 45 6e 63 6f 64 69 6e Transfer-Encodin 0010: 67 3a 20 63 68 75 6e 6b 65 64 0d 0a g: chunked.. <= Recv header, 25 bytes (0x19) 0000: 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 Content-Type: te 0010: 78 74 2f 68 74 6d 6c 0d 0a xt/html..

    My suspects are Accept (which I recognize values from IE), no cache, ciphering type (longshot), URL base.

    Is the only way to investigate the sent HTTP headers with LWP to install a proxy ? It would be great with a -trace flag as in curl.

    Best regards
    /Johan
      I installed a Proxy (Proxy Workbench) and it seems to be some major problems with the communication. When I connected with curl, the connection started with a CONNECT message with the following content:
      000000 CONNECT 067 079 078 078 069 067 084 032 000008 login1.s 108 111 103 105 110 049 046 115 000016 wipnet.s 119 105 112 110 101 116 046 115 000024 e:443 HT 101 058 052 052 051 032 072 084 000032 TP/1.0.. 084 080 047 049 046 048 013 010 000040 User-Age 085 115 101 114 045 065 103 101 000048 nt: curl 110 116 058 032 099 117 114 108 000056 /7.9.8 ( 047 055 046 057 046 056 032 040 000064 i386-red 105 051 056 054 045 114 101 100 000072 hat-linu 104 097 116 045 108 105 110 117 000080 x-gnu) l 120 045 103 110 117 041 032 108 000088 ibcurl 7 105 098 099 117 114 108 032 055 000096 .9.8 (Op 046 057 046 056 032 040 079 112 000104 enSSL 0. 101 110 083 083 076 032 048 046 000112 9.7a) (i 057 046 055 097 041 032 040 105 000120 pv6 enab 112 118 054 032 101 110 097 098 000128 led).... 108 101 100 041 013 010 013 010

      While the LWP connection attempt started with a POST message:
      000000 POST htt 080 079 083 084 032 104 116 116 000008 ps://log 112 115 058 047 047 108 111 103 000016 in1.swip 105 110 049 046 115 119 105 112 000024 net.se/l 110 101 116 046 115 101 047 108 000032 ogin.php 111 103 105 110 046 112 104 112 000040 HTTP/1. 032 072 084 084 080 047 049 046 000048 1..TE: d 049 013 010 084 069 058 032 100 000056 eflate,g 101 102 108 097 116 101 044 103 000064 zip;q=0. 122 105 112 059 113 061 048 046 000072 3..Conne 051 013 010 067 111 110 110 101 t 000080 ction: T 099 116 105 111 110 058 032 084 000088 E, close 069 044 032 099 108 111 115 101 000096 ..Host: 013 010 072 111 115 116 058 032 000104 login1.s 108 111 103 105 110 049 046 115 000112 wipnet.s 119 105 112 110 101 116 046 115 000120 e..User- 101 013 010 085 115 101 114 045 000128 Agent: M 065 103 101 110 116 058 032 077 000136 ozilla/4 111 122 105 108 108 097 047 052 000144 .0 (comp 046 048 032 040 099 111 109 112 000152 atible; 097 116 105 098 108 101 059 032 000160 MSIE 6.0 077 083 073 069 032 054 046 048 000168 ; Window 059 032 087 105 110 100 111 119 000176 s NT 5.1 115 032 078 084 032 053 046 049 000184 )..Conte 041 013 010 067 111 110 116 101 000192 nt-Lengt 110 116 045 076 101 110 103 116 000200 h: 47..C 104 058 032 052 055 013 010 067 000208 ontent-T 111 110 116 101 110 116 045 084 000216 ype: app 121 112 101 058 032 097 112 112 000224 lication 108 105 099 097 116 105 111 110 000232 /x-www-f 047 120 045 119 119 119 045 102 000240 orm-urle 111 114 109 045 117 114 108 101 000248 ncoded.. 110 099 111 100 101 100 013 010 000256 .. 013 010

      The content transmitted for the working curl connection was unreadable after the CONNECT message which gave me the impression that the transmission was ciphered. In other words, it seems to me that LWP does not use ciphering (and perhaps also incorrect protocol).
      I have searched the man pages for LWP::UserAgent, but can not find anything relevant. Does this help ?

      Found the following in man Crypt::SSLeay
      LWP::UserAgent has its own methods of proxying which may work for you +and is likely incompatible with Crypt::SSLeay proxy support. To use LWP::UserAgent proxy support, try something like: my $ua = new LWP::UserAgent; $ua->proxy([qw( https http )], "$proxy_ip:$proxy_port"); At the time of this writing, libwww v5.6 seems to proxy https requests + fine with an Apache mod_proxy server. It sends a line like: GET https://www.nodeworks.com HTTP/1.1 to the proxy server, which is not the CONNECT request that some proxie +s would expect, so this may not work with other proxy servers than mo +d_proxy. The CONNECT method is used by Crypt::SSLeayâs internal prox +y support.

      Which makes me even more confused :-/

      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://332234]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found