1
1
from __future__ import annotations
2
+ from ssl import SSLContext
2
3
3
4
from apify_shared .utils import ignore_docs
4
5
58
59
API_VERSION = 'v2'
59
60
60
61
62
+
61
63
class _BaseApifyClient :
62
64
http_client : HTTPClient | HTTPClientAsync
63
65
@@ -70,6 +72,7 @@ def __init__(
70
72
max_retries : int | None = 8 ,
71
73
min_delay_between_retries_millis : int | None = 500 ,
72
74
timeout_secs : int | None = DEFAULT_TIMEOUT ,
75
+ ssl_ctx : SSLContext | str | bool = True
73
76
) -> None :
74
77
"""Initialize a new instance.
75
78
@@ -87,6 +90,7 @@ def __init__(
87
90
self .max_retries = max_retries or 8
88
91
self .min_delay_between_retries_millis = min_delay_between_retries_millis or 500
89
92
self .timeout_secs = timeout_secs or DEFAULT_TIMEOUT
93
+ self .ssl_ctx = ssl_ctx
90
94
91
95
def _options (self ) -> dict :
92
96
return {
@@ -109,6 +113,7 @@ def __init__(
109
113
max_retries : int | None = 8 ,
110
114
min_delay_between_retries_millis : int | None = 500 ,
111
115
timeout_secs : int | None = DEFAULT_TIMEOUT ,
116
+ ssl_ctx : SSLContext | str | bool = True
112
117
) -> None :
113
118
"""Initialize a new instance.
114
119
@@ -126,6 +131,7 @@ def __init__(
126
131
max_retries = max_retries ,
127
132
min_delay_between_retries_millis = min_delay_between_retries_millis ,
128
133
timeout_secs = timeout_secs ,
134
+ ssl_ctx = ssl_ctx ,
129
135
)
130
136
131
137
self .stats = Statistics ()
@@ -135,6 +141,7 @@ def __init__(
135
141
min_delay_between_retries_millis = self .min_delay_between_retries_millis ,
136
142
timeout_secs = self .timeout_secs ,
137
143
stats = self .stats ,
144
+ ssl_ctx = self .ssl_ctx ,
138
145
)
139
146
140
147
def actor (self , actor_id : str ) -> ActorClient :
0 commit comments