follow-up: THRIFT-3599 Validate client IP address against cert's SubjectAltName
Client: Python
Patch: Nobuaki Sukegawa
Fix required version of Python or dependency
This closes #914
diff --git a/lib/py/src/transport/sslcompat.py b/lib/py/src/transport/sslcompat.py
index 2d778d2..19cfaca 100644
--- a/lib/py/src/transport/sslcompat.py
+++ b/lib/py/src/transport/sslcompat.py
@@ -17,6 +17,8 @@
# under the License.
#
+import sys
+
from thrift.transport.TTransport import TTransportException
@@ -69,9 +71,10 @@
from backports.ssl_match_hostname import match_hostname
_match_hostname = match_hostname
except ImportError:
+ if sys.hexversion < 0x030500F0:
+ _match_has_ipaddress = False
try:
from ssl import match_hostname
_match_hostname = match_hostname
except ImportError:
_match_hostname = legacy_validate_callback
- _match_has_ipaddress = False