SSL error: 2.1.1 works but 2.2 doesn't
Walter Miller
w3miller at yahoo.com
Tue Apr 9 01:54:25 EDT 2002
Apologies if this has been discussed/solved already.
I looked for prior postings but haven't found a
solution for fixing this error I'm getting with
_socket.pyd on 2.2.
Using Gerhard Häring's "socket.pyd with SSL support
for Python 2.2 on Windows"
(http://www.cs.fhm.edu/~ifw00065/downloads/python22-win32-ssl.zip):
"""
Traceback (most recent call last):
File "C:\test.py", line 3, in ?
doc =
urllib2.urlopen("https://www.medi-cal.ca.gov").read()
File "C:\Python22\lib\urllib2.py", line 138, in
urlopen
return _opener.open(url, data)
File "C:\Python22\lib\urllib2.py", line 322, in open
'_open', req)
File "C:\Python22\lib\urllib2.py", line 301, in
_call_chain
result = func(*args)
File "C:\Python22\lib\urllib2.py", line 792, in
https_open
return self.do_open(httplib.HTTPS, req)
File "C:\Python22\lib\urllib2.py", line 774, in
do_open
code, msg, hdrs = h.getreply()
File "C:\Python22\lib\httplib.py", line 728, in
getreply
response = self._conn.getresponse()
File "C:\Python22\lib\httplib.py", line 572, in
getresponse
response = self.response_class(self.sock)
File "C:\Python22\lib\httplib.py", line 98, in
__init__
self.fp = sock.makefile('rb', 0)
File "C:\Python22\lib\httplib.py", line 607, in
makefile
buf = self.__ssl.read()
socket.sslerror: (5, 'EOF occurred in violation of
protocol')
""""
Here's the code:
"""
import urllib2
doc =
urllib2.urlopen("https://www.medi-cal.ca.gov").read()
print doc
"""
This works using Python 2.1.1 and Al Dass's
_socket.pyd:
http://home.attbi.com/~al.dass/dev/python/2.1.1/win32_socket_ssl/python_2_1_1_ssl_socket.zip
any ideas? BTW, using Win2k Pro. I also verified
this on FreeBSD 4.5: Python 2.1.1 "works" (returns the
document) but all subsequent versions produce errors.
Walter
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
More information about the Python-list
mailing list