Merge branch 'master' into next

This commit is contained in:
Nicolas Sebrecht 2011-01-18 18:40:29 +01:00
commit 87d5ea3057

View File

@ -134,8 +134,9 @@ class WrappedIMAP4_SSL(IMAP4_SSL):
self.certfile) self.certfile)
else: else:
#ssl.wrap_socket worked and cert is verified, now check #ssl.wrap_socket worked and cert is verified (if configured),
#that hostnames also match. #now check that hostnames also match if we have a CA cert.
if self._cacertfile:
error = self._verifycert(self.sslobj.getpeercert(), host) error = self._verifycert(self.sslobj.getpeercert(), host)
if error: if error:
raise ssl.SSLError("SSL Certificate host name mismatch: %s" % error) raise ssl.SSLError("SSL Certificate host name mismatch: %s" % error)