From f19a6ef2c9e87f7a5429b2fcf0705265bdeb8b34 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sat, 19 Oct 2013 09:52:09 -0700 Subject: Verify hostname if verify_mode is CERT_OPTIONAL too. --- Lib/asyncio/selector_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- cgit v0.12