[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-09-29 Thread Ryan Tucker

Changes by Ryan Tucker rtuc...@gmail.com:


--
nosy: +Ryan.Tucker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1589
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5949] IMAP4_SSL spin because of SSLSocket.suppress_ragged_eofs

2009-08-17 Thread Ryan Tucker

Ryan Tucker r...@hoopycat.com added the comment:

I can reproduce this problem with Python 2.6.  It manifests itself as a
lengthy iteration through an IMAP SSL mailbox locking up after a long
while and the interpreter consuming all available system memory.

I suspect this to be the combination of doom:

imaplib.py:
   1166 def readline(self):
   1167 Read line from remote.
   1168 line = []
   1169 while 1:
   1170 char = self.sslobj.read(1)
   1171 line.append(char)
   1172 if char == \n: return ''.join(line)

ssl.py:
130 def read(self, len=1024):
131 
132 Read up to LEN bytes and return them.
133 Return zero-length string on EOF.
134 
135 try:
136 return self._sslobj.read(len)
137 except SSLError, x:
138 if x.args[0] == SSL_ERROR_EOF and
self.suppress_ragged_eofs:
139 return ''
140 else:
141 raise

After setting suppress_ragged_eofs=False, I now get:

ssl.SSLError: [Errno 8] _ssl.c:1325: EOF occurred in violation of protocol

... instead of an explosion.  This I can trap and handle much more
easily than an infinite loop appending '' to a list on each iteration :-)

I can reliably reproduce this against my gmail mailbox, although it does
take some number of hours.  I am not sure if this would be an imaplib
bug or a ssl bug; I'd think ssl, because it is Not the Python Way to
bury an exception like this.

--
nosy: +rtucker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5949
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com