urllib2 not support proxy on SSL connection?

itay_k itayyy at gmail.com
Tue May 2 23:22:24 CEST 2006


I am running the following simple code (just open connection to some
https page with proxy):

proxy= '666.179.227.666:80'
opener = urllib2.build_opener(proxy)
request = urllib2.Request('https://somehttpspage....')
response = opener.open(request)

And I get this error:
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python24\lib\urllib2.py", line 358, in open
    response = self._open(req, data)
  File "C:\Python24\lib\urllib2.py", line 376, in _open
    '_open', req)
  File "C:\Python24\lib\urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "C:\Python24\lib\urllib2.py", line 1029, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "C:\Python24\lib\urllib2.py", line 996, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (1, 'error:140770FC:SSL
ER_HELLO:unknown protocol')>

Is it possible that urllib2 doesnt support for proxy over https

Thanks alot,

More information about the Python-list mailing list