Skip to content

Commit 2c440e8

Browse files
committed
Only emit new warning for server_hostname=None
1 parent ff79789 commit 2c440e8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Lib/ssl.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,8 @@ def _create(cls, incoming, outgoing, server_side=False,
810810
if session is not None:
811811
raise ValueError("session can only be specified in "
812812
"client mode")
813-
if context.check_hostname and not server_hostname:
813+
if context.check_hostname and server_hostname is None:
814+
# Note: server_hostname='' is handled within _wrap_bio().
814815
warnings.warn("check_hostname requires server_hostname",
815816
category=DeprecationWarning,
816817
stacklevel=3)

0 commit comments

Comments
 (0)