]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Verify hostname if verify_mode is CERT_OPTIONAL too.
authorGuido van Rossum <guido@dropbox.com>
Sat, 19 Oct 2013 16:52:09 +0000 (09:52 -0700)
committerGuido van Rossum <guido@dropbox.com>
Sat, 19 Oct 2013 16:52:09 +0000 (09:52 -0700)
Lib/asyncio/selector_events.py

index 63164f058bbf5e59f20b4b8d4932fa691ea1a520..dee23064b7b6aa8b7ca26dc8a4a3aa280579aff7 100644 (file)
@@ -604,7 +604,7 @@ class _SelectorSslTransport(_SelectorTransport):
         # Verify hostname if requested.
         peercert = self._sock.getpeercert()
         if (self._server_hostname is not None and
-            self._sslcontext.verify_mode == ssl.CERT_REQUIRED):
+            self._sslcontext.verify_mode != ssl.CERT_NONE):
             try:
                 ssl.match_hostname(peercert, self._server_hostname)
             except Exception as exc: