Skip to content

fix: do not set assert_hostname=True #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/sasctl/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ def __init__(
def is_ipaddress(hst):
return re.match(r"^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$", hst)

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

self.mount("https://", adapter)
Expand Down
Loading