summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/selector_events.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2013-10-19 16:52:09 (GMT)
committerGuido van Rossum <guido@dropbox.com>2013-10-19 16:52:09 (GMT)
commitf19a6ef2c9e87f7a5429b2fcf0705265bdeb8b34 (patch)
tree8e9e6b5cb647024612e7e902e47eacd8fcebc420 /Lib/asyncio/selector_events.py
parent3743711a96e500d30e7084f74f49431547008392 (diff)
downloadcpython-f19a6ef2c9e87f7a5429b2fcf0705265bdeb8b34.zip
cpython-f19a6ef2c9e87f7a5429b2fcf0705265bdeb8b34.tar.gz
cpython-f19a6ef2c9e87f7a5429b2fcf0705265bdeb8b34.tar.bz2
Verify hostname if verify_mode is CERT_OPTIONAL too.
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r--Lib/asyncio/selector_events.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index 63164f0..dee2306 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -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: