|
34 | 34 | # ----------------------------------------------------------------------------- |
35 | 35 |
|
36 | 36 | import functools |
37 | | -from typing import Union, Callable |
| 37 | +from typing import Union, Callable, Any |
38 | 38 |
|
39 | 39 | import oracledb |
40 | 40 |
|
@@ -92,6 +92,7 @@ def __init__( |
92 | 92 | supershardingkey: list = None, |
93 | 93 | debug_jdwp: str = None, |
94 | 94 | connection_id_prefix: str = None, |
| 95 | + ssl_context: Any = None, |
95 | 96 | handle: int = 0, |
96 | 97 | threaded: bool = True, |
97 | 98 | encoding: str = None, |
@@ -243,6 +244,12 @@ def __init__( |
243 | 244 | - connection_id_prefix: an application specific prefix that is added to |
244 | 245 | the connection identifier used for tracing (default: None) |
245 | 246 |
|
| 247 | + - ssl_context: an SSLContext object used for connecting to the database |
| 248 | + using TLS. This SSL context will be modified to include the private |
| 249 | + key or any certificates found in a separately supplied wallet. This |
| 250 | + parameter should only be specified if the default SSLContext object |
| 251 | + cannot be used. (default: None) |
| 252 | +
|
246 | 253 | - handle: an integer representing a pointer to a valid service context |
247 | 254 | handle. This value is only used in thick mode. It should be used with |
248 | 255 | extreme caution (default: 0) |
@@ -285,7 +292,8 @@ def __repr__(self): |
285 | 292 | + f"shardingkey={self.shardingkey!r}, " |
286 | 293 | + f"supershardingkey={self.supershardingkey!r}, " |
287 | 294 | + f"debug_jdwp={self.debug_jdwp!r}, " |
288 | | - + f"connection_id_prefix={self.connection_id_prefix!r}" |
| 295 | + + f"connection_id_prefix={self.connection_id_prefix!r}, " |
| 296 | + + f"ssl_context={self.ssl_context!r}" |
289 | 297 | + ")" |
290 | 298 | ) |
291 | 299 |
|
@@ -532,6 +540,17 @@ def sid(self) -> Union[list, str]: |
532 | 540 | """ |
533 | 541 | return self._impl.sid |
534 | 542 |
|
| 543 | + @property |
| 544 | + def ssl_context(self) -> Any: |
| 545 | + """ |
| 546 | + An SSLContext object used for connecting to the database using TLS. |
| 547 | + This SSL context will be modified to include the private key or any |
| 548 | + certificates found in a separately supplied wallet. This parameter |
| 549 | + should only be specified if the default SSLContext object cannot be |
| 550 | + used.. |
| 551 | + """ |
| 552 | + return self._impl.ssl_context |
| 553 | + |
535 | 554 | @property |
536 | 555 | @_description_attr |
537 | 556 | def ssl_server_cert_dn(self) -> Union[list, str]: |
@@ -679,6 +698,7 @@ def set( |
679 | 698 | supershardingkey: list = None, |
680 | 699 | debug_jdwp: str = None, |
681 | 700 | connection_id_prefix: str = None, |
| 701 | + ssl_context: Any = None, |
682 | 702 | handle: int = None, |
683 | 703 | threaded: bool = None, |
684 | 704 | encoding: str = None, |
@@ -821,6 +841,12 @@ def set( |
821 | 841 | - connection_id_prefix: an application specific prefix that is added to |
822 | 842 | the connection identifier used for tracing |
823 | 843 |
|
| 844 | + - ssl_context: an SSLContext object used for connecting to the database |
| 845 | + using TLS. This SSL context will be modified to include the private |
| 846 | + key or any certificates found in a separately supplied wallet. This |
| 847 | + parameter should only be specified if the default SSLContext object |
| 848 | + cannot be used. |
| 849 | +
|
824 | 850 | - handle: an integer representing a pointer to a valid service context |
825 | 851 | handle. This value is only used in thick mode. It should be used with |
826 | 852 | extreme caution |
|
0 commit comments