Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > "unknown protocol" error in httplib using HTTPS

Reply
Thread Tools

"unknown protocol" error in httplib using HTTPS

 
 
Manish Jethani
Guest
Posts: n/a
 
      12-21-2003
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected 411 error response using httplib John Gordon Python 1 09-11-2009 04:53 PM
httplib and HTTPS Connections runningwild Python 5 10-19-2006 12:08 AM
httplib/HTTPS Post Problem michaelparkin@gmail.com Python 4 07-22-2005 09:47 AM
"unknown protocol" error in httplib using HTTPS Robert Python 0 04-05-2005 02:12 PM
Error using httplib documentation example code Brian Beck Python 1 10-09-2004 12:10 AM



Advertisments