@@ -45,8 +45,13 @@ class ArangoClient:
45
45
the de-serialized object. If not given, ``json.loads`` is used by
46
46
default.
47
47
:type deserializer: callable
48
- :param verify_certificate: Verify TLS certificates.
49
- :type verify_certificate: bool
48
+ :param verify_override: Override TLS certificate verification. This will
49
+ override the verify method of the underlying HTTP client.
50
+ None: Do not change the verification behavior of the underlying HTTP client.
51
+ True: Verify TLS certificate using the system CA certificates.
52
+ False: Do not verify TLS certificate.
53
+ str: Path to a custom CA bundle file or directory.
54
+ :type verify_override: Union[bool, str, None]
50
55
"""
51
56
52
57
def __init__ (
@@ -57,7 +62,7 @@ def __init__(
57
62
http_client : Optional [HTTPClient ] = None ,
58
63
serializer : Callable [..., str ] = lambda x : dumps (x ),
59
64
deserializer : Callable [[str ], Any ] = lambda x : loads (x ),
60
- verify_certificate : bool = True ,
65
+ verify_override : Union [ bool , str , None ] = None ,
61
66
) -> None :
62
67
if isinstance (hosts , str ):
63
68
self ._hosts = [host .strip ("/" ) for host in hosts .split ("," )]
@@ -79,9 +84,10 @@ def __init__(
79
84
self ._deserializer = deserializer
80
85
self ._sessions = [self ._http .create_session (h ) for h in self ._hosts ]
81
86
82
- # set flag for SSL/TLS certificate verification
83
- for session in self ._sessions :
84
- session .verify = verify_certificate
87
+ # override SSL/TLS certificate verification if provided
88
+ if verify_override is not None :
89
+ for session in self ._sessions :
90
+ session .verify = verify_override
85
91
86
92
def __repr__ (self ) -> str :
87
93
return f"<ArangoClient { ',' .join (self ._hosts )} >"
0 commit comments