Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f19a6ef

Browse files
author
Guido van Rossum
committed
Verify hostname if verify_mode is CERT_OPTIONAL too.
1 parent 3743711 commit f19a6ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/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)