[pyar] Proxy en Pyhon

Sebastian Bassi sebastian.bassi en globant.com
Jue Mar 10 16:25:46 ART 2011


Tengo este problema (Puse algunas "x" por ahi para no poner dominios
reales):
(estoy detras de un proxy).

Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.
>>> import urllib
>>> urllib.getproxies()
{'ftp': 'ftp://proxy.x.com:3128', 'http': 'http://proxy.x.com:3128',
'https': 'https://proxy.x.com:3128'}
>>> urllib.urlopen("https://x.x.com:8443/x/login.do")

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    urllib.urlopen("https://x.x.com:8443/glow/login.do")
  File "C:\Python27\lib\urllib.py", line 84, in urlopen
    return opener.open(url)
  File "C:\Python27\lib\urllib.py", line 205, in open
    return getattr(self, name)(url)
  File "C:\Python27\lib\urllib.py", line 435, in open_https
    h.endheaders(data)
  File "C:\Python27\lib\httplib.py", line 937, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 797, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 759, in send
    self.connect()
  File "C:\Python27\lib\httplib.py", line 1144, in connect
    self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File "C:\Python27\lib\ssl.py", line 344, in wrap_socket
    ciphers=ciphers)
  File "C:\Python27\lib\ssl.py", line 121, in __init__
    self.do_handshake()
  File "C:\Python27\lib\ssl.py", line 283, in do_handshake
    self._sslobj.do_handshake()
IOError: [Errno socket error] [Errno 1] _ssl.c:499: error:140770FC:SSL
routines:SSL23_GET_SERVER_HELLO:unknown protocol

Si en lugar de usar una dirección de https, uso http, funciona sin
problemas.
Pareceria ser este bug de Python (http://bugs.python.org/issue1424152), pero
supuestamente en mi versión (2.7.1) estaría arreglada.



-- 
Sebastián Bassi. *sebastian.bassi en globant.com*
Lic. en Biotecnología con orientación en genética molecular.
Software Developer @ Globant.
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20110310/61776b08/attachment.html>


More information about the pyar mailing list