httplib drops ssl connection to MS IIS Server

Ng Pheng Siong ngps at vista.netmemetic.com
Mon Apr 15 10:05:04 EDT 2002


According to Marco Caamano  <mvcc_cr at yahoo.com>:
> I've been experiencing some problems with ssl connections using httplib.
> When executed it connects to the server and then drops on the following 
> error:
> socket.sslerror: (5, 'EOF occurred in violation of protocol')
> ----------------
>
> I'll really apreciate a pointer here, what I am doing wrong? what should
> I try next?

M2Crypto:

ngps at vista:~$ python
Python 2.2 (#7, Mar 31 2002, 23:17:41) 
[GCC 2.95.3 20010315 (release) [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> from M2Crypto import httpslib
>>> body = '\202test' 
>>> host = ('209.154.200.218:443')
>>> hs = httpslib.HTTPS()
>>> hs.set_debuglevel(4)
>>> hs.connect(host)
>>> hs.putrequest('POST', '/scripts/gateway.dll?Transact')
send: 'POST /scripts/gateway.dll?Transact HTTP/1.0\r\n'
>>> hs.putheader('Content-Type','x-Visa-II/x-auth')
send: 'Content-Type: x-Visa-II/x-auth\r\n'
>>> hs.putheader('Content-Length', str(len(body)))
send: 'Content-Length: 5\r\n'
>>> hs.endheaders()
send: '\r\n'
>>> hs.send(body)
send: '\x82test'
>>> status, reason, header= hs.getreply()
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: Microsoft-IIS/4.0
header: Date: Mon, 15 Apr 2002 14:18:46 GMT
header: Content-Type: x-data/xact-error
>>> data=hs.getfile().read()
>>> print data
510 - Authorization request must be an Interleave (application type 4).

>>> print status
200
>>> 

Get M2Crypto here:

    http://www.post1.com/home/ngps/m2/


I'll soon write a bot to auto-answer such questions. ;-)


-- 
Ng Pheng Siong <ngps at netmemetic.com> * http://www.netmemetic.com




More information about the Python-list mailing list