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

Merge branch 'fix-default-cert' into 'dev'

Fix missing default certificates

See merge request caosdb/caosdb-pylib!16
parents 8bd1f1a4 4aeafcf6
Branches
Tags
No related merge requests found
...@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [pytest](https://docs.pytest.org/en/latest/) is the new preferred unit test frame work. - [pytest](https://docs.pytest.org/en/latest/) is the new preferred unit test frame work.
- If a password is specified in the configuration even though the password_method is not set to `plain`, a warning is logged. - If a password is specified in the configuration even though the password_method is not set to `plain`, a warning is logged.
- Under the hood, the password of from a `pass` or `keyring` call is not stored anymore. Instead the password is requested each time a login is necessary. - Under the hood, the password of from a `pass` or `keyring` call is not stored anymore. Instead the password is requested each time a login is necessary.
- Always load system default CA repository into the ssl context
### Deprecated ### Deprecated
......
...@@ -32,14 +32,13 @@ from builtins import str # pylint: disable=redefined-builtin ...@@ -32,14 +32,13 @@ from builtins import str # pylint: disable=redefined-builtin
from errno import EPIPE as BrokenPipe from errno import EPIPE as BrokenPipe
from socket import error as SocketError from socket import error as SocketError
from pkg_resources import resource_filename
from caosdb.configuration import get_config from caosdb.configuration import get_config
from caosdb.exceptions import (AuthorizationException, CaosDBException, from caosdb.exceptions import (AuthorizationException, CaosDBException,
ClientErrorException, ConfigurationException, ClientErrorException, ConfigurationException,
ConnectionException, EntityDoesNotExistError, ConnectionException, EntityDoesNotExistError,
LoginFailedException, ServerErrorException, LoginFailedException, ServerErrorException,
URITooLongException) URITooLongException)
from pkg_resources import resource_filename
from .interface import CaosDBHTTPResponse, CaosDBServerConnection from .interface import CaosDBHTTPResponse, CaosDBServerConnection
from .streaminghttp import StreamingHTTPSConnection from .streaminghttp import StreamingHTTPSConnection
...@@ -197,6 +196,8 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection): ...@@ -197,6 +196,8 @@ class _DefaultCaosDBServerConnection(CaosDBServerConnection):
"`{}`: {}".format(config["cacert"], "`{}`: {}".format(config["cacert"],
exc)) exc))
context.load_default_certs()
if "url" in config: if "url" in config:
parsed_url = parse_url(config["url"]) parsed_url = parse_url(config["url"])
host = parsed_url.netloc host = parsed_url.netloc
...@@ -336,7 +337,7 @@ def configure_connection(**kwargs): ...@@ -336,7 +337,7 @@ def configure_connection(**kwargs):
global_conf = {} global_conf = {}
conf = get_config() conf = get_config()
# Convert config to dict, with preserving types # Convert config to dict, with preserving types
int_opts = ["timeout"] int_opts = ["timeout"]
bool_opts = ["ssl_insecure"] bool_opts = ["ssl_insecure"]
if conf.has_section("Connection"): if conf.has_section("Connection"):
global_conf = dict(conf.items("Connection")) global_conf = dict(conf.items("Connection"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment