"unknown protocol" error in httplib using HTTPS

Discussion in 'Python' started by Manish Jethani, Dec 21, 2003.

  1. I'm using Python 2.3.3 to do HTTPS using the httplib module.
    Here's the code:

    from httplib import HTTPSConnection
    con = HTTPSConnection('www-proxy', 80)
    con.set_debuglevel(1)
    con.request('GET',
    'https://nexus.passport.com:443/rdr/pprdr.asp')
    res = con.getresponse()
    print res.status, res.reason
    print res.read()

    Here, "www-proxy" is the HTTPS proxy server that I have to go
    through (I can't connect directly). I'm trying to GET
    "https://nexus.passport.com:443/rdr/pprdr.asp" via the proxy,
    but I'm getting a "unknown protocol" error in return:

    File "test.py", line 9, in ?
    con.request('GET',
    'https://nexus.passport.com:443/rdr/pprdr.asp')
    File "c:\python23\lib\httplib.py", line 718, in request
    self._send_request(method, url, body, headers)
    File "c:\python23\lib\httplib.py", line 739, in _send_request
    self.endheaders()
    File "c:\python23\lib\httplib.py", line 712, in endheaders
    self._send_output()
    File "c:\python23\lib\httplib.py", line 597, in _send_output
    self.send(msg)
    File "c:\python23\lib\httplib.py", line 564, in send
    self.connect()
    File "c:\python23\lib\httplib.py", line 985, in connect
    ssl = socket.ssl(sock, self.key_file, self.cert_file)
    File "c:\python23\lib\socket.py", line 73, in ssl
    return _realssl(sock, keyfile, certfile) socket.sslerror:
    (1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown
    protocol')

    What's the problem here? I just want to use SSL over my HTTPS
    proxy using httplib.

    Any help.

    Thanks!

    Manish

    --
    http://mannu.livejournal.com/
    Manish Jethani, Dec 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. christian_stengel
    Replies:
    0
    Views:
    2,598
    christian_stengel
    Jan 26, 2005
  2. Robert
    Replies:
    0
    Views:
    702
    Robert
    Apr 5, 2005
  3. Benjamin Schollnick
    Replies:
    0
    Views:
    781
    Benjamin Schollnick
    Apr 20, 2005
  4. Replies:
    4
    Views:
    1,123
  5. Robert
    Replies:
    0
    Views:
    1,470
    Robert
    Aug 31, 2005
Loading...

Share This Page