"unknown protocol" error in httplib using HTTPS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert

    #1

    "unknown protocol" error in httplib using HTTPS

    did you solve this problem? It seems to be still present here with
    py2.3.5.

    Robert

    --
    From: Manish Jethani <manish.j@gmx.n et>
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b)
    Gecko/20031205 Thunderbird/0.4
    X-Accept-Language: en-us, en
    MIME-Version: 1.0
    Newsgroups: comp.lang.pytho n
    Subject: "unknown protocol" error in httplib using HTTPS
    Content-Type: text/plain; charset=us-ascii; format=flowed
    Content-Transfer-Encoding: 7bit
    Lines: 48
    Message-ID: <fohFb.3$R63.10 6@news.oracle.c om>
    Date: Sun, 21 Dec 2003 18:44:53 +0530
    NNTP-Posting-Host: 152.69.162.185
    X-Trace: news.oracle.com 1072013963 152.69.162.185 (Sun, 21 Dec 2003
    05:39:23 PST)
    NNTP-Posting-Date: Sun, 21 Dec 2003 05:39:23 PST


    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_debugle vel(1)
    con.request('GE T',
    '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('GE T',
    'https://nexus.passport. com:443/rdr/pprdr.asp')
    File "c:\python23\li b\httplib.py", line 718, in request
    self._send_requ est(method, url, body, headers)
    File "c:\python23\li b\httplib.py", line 739, in _send_request
    self.endheaders ()
    File "c:\python23\li b\httplib.py", line 712, in endheaders
    self._send_outp ut()
    File "c:\python23\li b\httplib.py", line 597, in _send_output
    self.send(msg)
    File "c:\python23\li b\httplib.py", line 564, in send
    self.connect()
    File "c:\python23\li b\httplib.py", line 985, in connect
    ssl = socket.ssl(sock , self.key_file, self.cert_file)
    File "c:\python23\li b\socket.py", line 73, in ssl
    return _realssl(sock, keyfile, certfile) socket.sslerror :
    (1, 'error:140770FC :SSL routines:SSL23_ GET_SERVER_HELL O:unknown
    protocol')

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

    Any help.

    Thanks!

    Manish

    --

Working...