Skip to content

Commit 8471812

Browse files
Made ODH cert default cert for Token Auth
1 parent 32cb751 commit 8471812

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/codeflare_sdk/cluster/auth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ def login(self) -> str:
101101
"""
102102
global config_path
103103
global api_client
104+
odh_ca_path = "/etc/pki/tls/custom-certs/ca-bundle.crt"
104105
try:
105106
configuration = client.Configuration()
106107
configuration.api_key_prefix["authorization"] = "Bearer"
107108
configuration.host = self.server
108109
configuration.api_key["authorization"] = self.token
109110
if self.skip_tls == False and self.ca_cert_path == None:
111+
if os.path.isfile(odh_ca_path):
112+
print(f"Authenticated with certificate located at {odh_ca_path}")
113+
configuration.ssl_ca_cert = odh_ca_path
110114
configuration.verify_ssl = True
111115
elif self.skip_tls == False:
112116
configuration.ssl_ca_cert = self.ca_cert_path

0 commit comments

Comments
 (0)