Skip to content

Commit eee7387

Browse files
authored
fix: do not set assert_hostname=True (#201)
1 parent d30c1f8 commit eee7387

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sasctl/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,9 @@ def __init__(
327327
def is_ipaddress(hst):
328328
return re.match(r"^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$", hst)
329329

330-
verify_hostname = not is_ipaddress(hostname)
330+
# Do not verify hostname if IP address is used. Otherwise, will
331+
# verify that cert hostname matches the hostname used in the URL.
332+
verify_hostname = False if is_ipaddress(hostname) else None
331333
adapter = SSLContextAdapter(assert_hostname=verify_hostname)
332334

333335
self.mount("https://", adapter)

0 commit comments

Comments
 (0)