File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
CosmoTech_Acceleration_Library
cosmotech/coal/cosmotech_api Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11# Copyright (c) Cosmo Tech corporation.
22# Licensed under the MIT license.
33
4- __version__ = '0.8.6 '
4+ __version__ = '0.8.7 '
Original file line number Diff line number Diff line change 66# specifically authorized by written means by Cosmo Tech.
77import os
88import pathlib
9+ import ssl
910
1011import cosmotech_api
1112
@@ -39,10 +40,12 @@ def get_api_client() -> (cosmotech_api.ApiClient, str):
3940 client_id = os .environ .get ("IDP_CLIENT_ID" ),
4041 realm_name = os .environ .get ("IDP_TENANT_ID" ),
4142 client_secret_key = os .environ .get ("IDP_CLIENT_SECRET" ))
42- if (ca_cert_path := os .environ .get ("IDP_CA_CERT" )) and pathlib .Path (os .environ .get ("IDP_CA_CERT" )).is_file ():
43+ if (ca_cert_path := os .environ .get ("IDP_CA_CERT" )) and pathlib .Path (os .environ .get ("IDP_CA_CERT" )).exists ():
4344 LOGGER .info ("Found Certificate Authority override for IDP connection, using it." )
44- keycloack_parameters ["cert" ] = ca_cert_path
45-
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 )
4649 keycloak_openid = KeycloakOpenID (** keycloack_parameters )
4750
4851 access_token = keycloak_openid .token (grant_type = "client_credentials" )
You can’t perform that action at this time.
0 commit comments