Skip to content

Commit 26a1ef2

Browse files
authored
Merge pull request #19 from ydb-platform/root_ca
ability to use root_ca
2 parents e651225 + 6990736 commit 26a1ef2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ydb_dbapi/connections.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def __init__(
7373
protocol: str | None = None,
7474
credentials: ydb.Credentials | dict | str | None = None,
7575
ydb_session_pool: SessionPool | AsyncSessionPool | None = None,
76+
root_certificates_path: str | None = None,
7677
**kwargs: dict,
7778
) -> None:
7879
protocol = protocol if protocol else "grpc"
@@ -101,6 +102,7 @@ def __init__(
101102
database=self.database,
102103
credentials=self.credentials,
103104
query_client_settings=self._get_client_settings(),
105+
root_certificates=ydb.load_ydb_root_certificate(root_certificates_path),
104106
)
105107
self._driver = self._driver_cls(driver_config)
106108
self._session_pool = self._pool_cls(self._driver, size=5)
@@ -176,6 +178,7 @@ def __init__(
176178
protocol: str | None = None,
177179
credentials: ydb.Credentials | None = None,
178180
ydb_session_pool: SessionPool | AsyncSessionPool | None = None,
181+
root_certificates_path: str | None = None,
179182
**kwargs: dict,
180183
) -> None:
181184
super().__init__(
@@ -186,6 +189,7 @@ def __init__(
186189
protocol=protocol,
187190
credentials=credentials,
188191
ydb_session_pool=ydb_session_pool,
192+
root_certificates_path=root_certificates_path,
189193
**kwargs,
190194
)
191195
self._current_cursor: Cursor | None = None
@@ -349,6 +353,7 @@ def __init__(
349353
protocol: str | None = None,
350354
credentials: ydb.Credentials | None = None,
351355
ydb_session_pool: SessionPool | AsyncSessionPool | None = None,
356+
root_certificates_path: str | None = None,
352357
**kwargs: dict,
353358
) -> None:
354359
super().__init__(
@@ -359,6 +364,7 @@ def __init__(
359364
protocol=protocol,
360365
credentials=credentials,
361366
ydb_session_pool=ydb_session_pool,
367+
root_certificates_path=root_certificates_path,
362368
**kwargs,
363369
)
364370
self._current_cursor: AsyncCursor | None = None

0 commit comments

Comments
 (0)