@@ -74,6 +74,7 @@ def __init__(
74
74
credentials : ydb .Credentials | dict | str | None = None ,
75
75
ydb_session_pool : SessionPool | AsyncSessionPool | None = None ,
76
76
root_certificates_path : str | None = None ,
77
+ root_certificates : str | None = None ,
77
78
** kwargs : dict ,
78
79
) -> None :
79
80
protocol = protocol if protocol else "grpc"
@@ -97,14 +98,17 @@ def __init__(
97
98
self ._session_pool ._query_client_settings = settings
98
99
self ._driver = self ._session_pool ._driver
99
100
else :
101
+ if root_certificates is None :
102
+ root_certificates = ydb .load_ydb_root_certificate (
103
+ root_certificates_path
104
+ )
105
+
100
106
driver_config = ydb .DriverConfig (
101
107
endpoint = self .endpoint ,
102
108
database = self .database ,
103
109
credentials = self .credentials ,
104
110
query_client_settings = self ._get_client_settings (),
105
- root_certificates = ydb .load_ydb_root_certificate (
106
- root_certificates_path
107
- ),
111
+ root_certificates = root_certificates ,
108
112
)
109
113
self ._driver = self ._driver_cls (driver_config )
110
114
self ._session_pool = self ._pool_cls (self ._driver , size = 5 )
@@ -181,6 +185,7 @@ def __init__(
181
185
credentials : ydb .Credentials | None = None ,
182
186
ydb_session_pool : SessionPool | AsyncSessionPool | None = None ,
183
187
root_certificates_path : str | None = None ,
188
+ root_certificates : str | None = None ,
184
189
** kwargs : dict ,
185
190
) -> None :
186
191
super ().__init__ (
@@ -192,6 +197,7 @@ def __init__(
192
197
credentials = credentials ,
193
198
ydb_session_pool = ydb_session_pool ,
194
199
root_certificates_path = root_certificates_path ,
200
+ root_certificates = root_certificates ,
195
201
** kwargs ,
196
202
)
197
203
self ._current_cursor : Cursor | None = None
@@ -369,6 +375,7 @@ def __init__(
369
375
credentials : ydb .Credentials | None = None ,
370
376
ydb_session_pool : SessionPool | AsyncSessionPool | None = None ,
371
377
root_certificates_path : str | None = None ,
378
+ root_certificates : str | None = None ,
372
379
** kwargs : dict ,
373
380
) -> None :
374
381
super ().__init__ (
@@ -380,6 +387,7 @@ def __init__(
380
387
credentials = credentials ,
381
388
ydb_session_pool = ydb_session_pool ,
382
389
root_certificates_path = root_certificates_path ,
390
+ root_certificates = root_certificates ,
383
391
** kwargs ,
384
392
)
385
393
self ._current_cursor : AsyncCursor | None = None
0 commit comments