Skip to content

Commit b8cfb65

Browse files
Merge pull request #1177 from gooddata/snapshot-master-f6134f9e-to-rel/dev
[bot] Merge master/f6134f9e into rel/dev
2 parents da041ff + f6134f9 commit b8cfb65

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

gooddata-sdk/gooddata_sdk/client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from __future__ import annotations
55

6+
from pathlib import Path
67
from typing import Optional
78

89
import gooddata_api_client as api_client
@@ -25,6 +26,7 @@ def __init__(
2526
custom_headers: Optional[dict[str, str]] = None,
2627
extra_user_agent: Optional[str] = None,
2728
executions_cancellable: bool = False,
29+
ssl_ca_cert: Optional[str] = None,
2830
) -> None:
2931
"""Take url, token for connecting to GoodData.CN.
3032
@@ -45,7 +47,14 @@ def __init__(
4547

4648
user_agent = f"{USER_AGENT} {extra_user_agent}" if extra_user_agent is not None else USER_AGENT
4749

48-
self._api_config = api_client.Configuration(host=host)
50+
if ssl_ca_cert is not None:
51+
ssl_ca_cert_path = Path(ssl_ca_cert)
52+
if not ssl_ca_cert_path.exists():
53+
raise ValueError(
54+
f"ssl_ca_cert file path specified but the file does not exist. Path: {ssl_ca_cert_path}."
55+
)
56+
57+
self._api_config = api_client.Configuration(host=host, ssl_ca_cert=ssl_ca_cert)
4958
self._api_client = api_client.ApiClient(
5059
configuration=self._api_config,
5160
header_name="Authorization",

gooddata-sdk/gooddata_sdk/sdk.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def create(
4747
token_: str,
4848
extra_user_agent_: Optional[str] = None,
4949
*,
50+
ssl_ca_cert: Optional[str] = None,
5051
executions_cancellable: bool = False,
5152
**custom_headers_: Optional[str],
5253
) -> GoodDataSdk:
@@ -64,6 +65,7 @@ def create(
6465
custom_headers=filtered_headers,
6566
extra_user_agent=extra_user_agent_,
6667
executions_cancellable=executions_cancellable,
68+
ssl_ca_cert=ssl_ca_cert,
6769
)
6870
return cls(client)
6971

0 commit comments

Comments
 (0)