SSL problem

Michel Van den Bergh vdbergh at luc.ac.be
Thu Jan 3 08:27:05 EST 2002


Hello,

I am having a problem with opening an https connection with the
following script:

#!/usr/bin/python2
import sys, httplib, urllib, re, getopt,time

h=httplib.HTTPSConnection('telemeter.telenet.be')
h.set_debuglevel(1)
h.request('GET','/be/telenet/afe/isps/TelemeterLogin.jsp')
response=h.getresponse()
h.close()

The output is:

send: 'GET /be/telenet/afe/isps/TelemeterLogin.jsp HTTP/1.1\r\n'
send: 'Host: telemeter.telenet.be:443\r\n'
send: 'Accept-Encoding: identity\r\n'
send: '\r\n'
Traceback (most recent call last):
  File "test.py", line 9, in ?
    response=h.getresponse()
  File "/usr/lib/python2.2/httplib.py", line 570, in getresponse
    response = self.response_class(self.sock, self.debuglevel)
  File "/usr/lib/python2.2/httplib.py", line 98, in __init__
    self.fp = sock.makefile('rb', 0)
  File "/usr/lib/python2.2/httplib.py", line 607, in makefile
    buf = self.__ssl.read()
socket.sslerror: (5, 'EOF occurred in violation of protocol')

Needless to say that Netscape and Konqueror can access this URL without
problems.
The same script works fine for other URLs.

Am I doing something wrong? Is there a way of debugging https
connections?
(Ethereal does not work for obvious reasons!).


All help appreciated!

egards,

Michel






More information about the Python-list mailing list