Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 114bcc3

Browse files
committed
Verify hostname if verify_mode is CERT_OPTIONAL too.
1 parent 8fc5b6d commit 114bcc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asyncio/selector_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def _on_handshake(self):
604604
# Verify hostname if requested.
605605
peercert = self._sock.getpeercert()
606606
if (self._server_hostname is not None and
607-
self._sslcontext.verify_mode == ssl.CERT_REQUIRED):
607+
self._sslcontext.verify_mode != ssl.CERT_NONE):
608608
try:
609609
ssl.match_hostname(peercert, self._server_hostname)
610610
except Exception as exc:

0 commit comments

Comments
 (0)