11from __future__ import annotations
2+ from ssl import SSLContext
23
34from apify_shared .utils import ignore_docs
45
5859API_VERSION = 'v2'
5960
6061
62+
6163class _BaseApifyClient :
6264 http_client : HTTPClient | HTTPClientAsync
6365
@@ -70,6 +72,7 @@ def __init__(
7072 max_retries : int | None = 8 ,
7173 min_delay_between_retries_millis : int | None = 500 ,
7274 timeout_secs : int | None = DEFAULT_TIMEOUT ,
75+ ssl_ctx : SSLContext | str | bool = True
7376 ) -> None :
7477 """Initialize a new instance.
7578
@@ -87,6 +90,7 @@ def __init__(
8790 self .max_retries = max_retries or 8
8891 self .min_delay_between_retries_millis = min_delay_between_retries_millis or 500
8992 self .timeout_secs = timeout_secs or DEFAULT_TIMEOUT
93+ self .ssl_ctx = ssl_ctx
9094
9195 def _options (self ) -> dict :
9296 return {
@@ -109,6 +113,7 @@ def __init__(
109113 max_retries : int | None = 8 ,
110114 min_delay_between_retries_millis : int | None = 500 ,
111115 timeout_secs : int | None = DEFAULT_TIMEOUT ,
116+ ssl_ctx : SSLContext | str | bool = True
112117 ) -> None :
113118 """Initialize a new instance.
114119
@@ -126,6 +131,7 @@ def __init__(
126131 max_retries = max_retries ,
127132 min_delay_between_retries_millis = min_delay_between_retries_millis ,
128133 timeout_secs = timeout_secs ,
134+ ssl_ctx = ssl_ctx ,
129135 )
130136
131137 self .stats = Statistics ()
@@ -135,6 +141,7 @@ def __init__(
135141 min_delay_between_retries_millis = self .min_delay_between_retries_millis ,
136142 timeout_secs = self .timeout_secs ,
137143 stats = self .stats ,
144+ ssl_ctx = self .ssl_ctx ,
138145 )
139146
140147 def actor (self , actor_id : str ) -> ActorClient :
0 commit comments