diff --git a/trustify/client/client.py b/trustify/client/client.py index 782aac1f8..21641c385 100644 --- a/trustify/client/client.py +++ b/trustify/client/client.py @@ -132,18 +132,18 @@ def is_hostname_sane(hostname): import string as s allowed = s.ascii_letters + s.digits + "-." # hostnames & IPv4 if all([c in allowed for c in hostname]): - return True + return True if not allow_raw_ipv6_server: return False # ipv6 is messy and complicated, can contain %zoneindex etc. import socket try: - # is this a valid IPv6 address? - socket.getaddrinfo(hostname,443,socket.AF_INET6) - return True + # is this a valid IPv6 address? + socket.getaddrinfo(hostname,443,socket.AF_INET6) + return True except: - return False + return False