diff --git a/src/caosdb/connection/connection.py b/src/caosdb/connection/connection.py index 992efd60d4d1c37ac3a407ab744a31842f34b43b..9bd1b82a02ba1bf4a25891d79b0abf0ef71a4840 100644 --- a/src/caosdb/connection/connection.py +++ b/src/caosdb/connection/connection.py @@ -333,8 +333,21 @@ def configure_connection(**kwargs): _Connection The singleton instance of the _Connection class. """ - global_conf = (dict(get_config().items("Connection")) if - get_config().has_section("Connection") else dict()) + global_conf = {} + conf = get_config() + # Convert config to dict, with preserving types + int_opts = ["timeout"] + bool_opts = ["ssl_insecure"] + if conf.has_section("Connection"): + global_conf = dict(conf.items("Connection")) + # Integer options + for opt in int_opts: + if opt in global_conf: + global_conf[opt] = conf.getint("Connection", opt) + # Boolean options + for opt in bool_opts: + if opt in global_conf: + global_conf[opt] = conf.getboolean("Connection", opt) local_conf = _make_conf(_DEFAULT_CONF, global_conf, kwargs) connection = _Connection.get_instance()