Skip to content

Commit b5702ed

Browse files
committed
Fixed SSL verification as per the asyncio code
1 parent daa7522 commit b5702ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

redis/anyio/connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ def __init__(
832832
cert_reqs: Optional[str] = None,
833833
ca_certs: Optional[str] = None,
834834
ca_data: Optional[str] = None,
835-
check_hostname: bool = False,
835+
check_hostname: bool = True,
836836
min_version: Optional[TLSVersion] = None,
837837
ciphers: Optional[str] = None,
838838
):
@@ -856,7 +856,9 @@ def __init__(
856856
self.cert_reqs = CERT_REQS[cert_reqs]
857857
self.ca_certs = ca_certs
858858
self.ca_data = ca_data
859-
self.check_hostname = check_hostname
859+
self.check_hostname = (
860+
check_hostname if self.cert_reqs != ssl.CERT_NONE else False
861+
)
860862
self.min_version = min_version
861863
self.ciphers = ciphers
862864
self.context: Optional[SSLContext] = None

0 commit comments

Comments
 (0)