Skip to content
Snippets Groups Projects
Verified Commit 8b6d2eec authored by Timm Fitschen's avatar Timm Fitschen
Browse files

MAINT: remove errors for pre-3.4 python ssl

parent 95a00d96
No related branches found
No related tags found
1 merge request!61MAINT: Drop support for Python 3.6 and 3.7
Pipeline #24110 passed
...@@ -176,18 +176,7 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection): ...@@ -176,18 +176,7 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
if "ssl_version" in config and config["cacert"] is not None: if "ssl_version" in config and config["cacert"] is not None:
ssl_version = getattr(ssl, config["ssl_version"]) ssl_version = getattr(ssl, config["ssl_version"])
else: else:
try: ssl_version = ssl.PROTOCOL_TLS
ssl_version = ssl.PROTOCOL_TLS
except AttributeError:
# TODO(tfitschen): This can be removed since we require Python
# >= 3.8 anyway, can't it?
# deprecated since Python 3.6, but necessary until there.
try:
ssl_version = ssl.PROTOCOL_TLSv1_2
except AttributeError:
print("It seems as if your Python version does not support current encryption"
"standards (such as TLS > 1.0), please upgrade to at least Python 3.4.")
sys.exit(1)
context = ssl.SSLContext(ssl_version) context = ssl.SSLContext(ssl_version)
context.verify_mode = ssl.CERT_REQUIRED context.verify_mode = ssl.CERT_REQUIRED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment