Skip to content

Commit 4d34fd4

Browse files
committed
fix: reomve use of sslContext for keycloack verify
1 parent 085c0d1 commit 4d34fd4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cosmotech/coal/cosmotech_api/connection.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ def get_api_client() -> (cosmotech_api.ApiClient, str):
4040
client_id=os.environ.get("IDP_CLIENT_ID"),
4141
realm_name=os.environ.get("IDP_TENANT_ID"),
4242
client_secret_key=os.environ.get("IDP_CLIENT_SECRET"))
43-
if (ca_cert_path := os.environ.get("IDP_CA_CERT")) and pathlib.Path(os.environ.get("IDP_CA_CERT")).exists():
43+
if (ca_cert_path := os.environ.get("IDP_CA_CERT")) and pathlib.Path(ca_cert_path).exists():
4444
LOGGER.info("Found Certificate Authority override for IDP connection, using it.")
45-
if pathlib.Path(ca_cert_path).is_file():
46-
keycloack_parameters["verify"] = ssl.create_default_context(cafile=ca_cert_path)
47-
else:
48-
keycloack_parameters["verify"] = ssl.create_default_context(capath=ca_cert_path)
45+
keycloack_parameters["verify"] = ca_cert_path
4946
keycloak_openid = KeycloakOpenID(**keycloack_parameters)
5047

5148
access_token = keycloak_openid.token(grant_type="client_credentials")

0 commit comments

Comments
 (0)