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

ENH: new Connection.ssl_protocol in pycaosdb.ini

parent 25da7a1b
Branches
Tags
No related merge requests found
...@@ -142,7 +142,11 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection): ...@@ -142,7 +142,11 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
If no url has been specified, or if the CA certificate cannot be If no url has been specified, or if the CA certificate cannot be
loaded. loaded.
""" """
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) if "ssl_version" in config and config["cacert"] is not None:
ssl_version = getattr(ssl, config["ssl_version"])
else:
ssl_version = ssl.PROTOCOL_TLSv1
context = ssl.SSLContext(ssl_version)
context.verify_mode = ssl.CERT_REQUIRED context.verify_mode = ssl.CERT_REQUIRED
if hasattr(context, "check_hostname"): if hasattr(context, "check_hostname"):
context.check_hostname = True context.check_hostname = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment