1616
1717if TYPE_CHECKING :
1818 from collections .abc import Iterable
19+ from ssl import SSLContext
1920
2021 from crawlee ._types import HttpMethod , HttpPayload
2122 from crawlee .base_storage_client ._models import Request
@@ -101,6 +102,7 @@ def __init__(
101102 ignore_http_error_status_codes : Iterable [int ] = (),
102103 http1 : bool = True ,
103104 http2 : bool = True ,
105+ verify : str | bool | SSLContext = True ,
104106 header_generator : HeaderGenerator | None = _DEFAULT_HEADER_GENERATOR ,
105107 ** async_client_kwargs : Any ,
106108 ) -> None :
@@ -112,6 +114,7 @@ def __init__(
112114 ignore_http_error_status_codes: HTTP status codes to ignore as errors.
113115 http1: Whether to enable HTTP/1.1 support.
114116 http2: Whether to enable HTTP/2 support.
117+ verify: SSL certificates used to verify the identity of requested hosts.
115118 header_generator: Header generator instance to use for generating common headers.
116119 async_client_kwargs: Additional keyword arguments for `httpx.AsyncClient`.
117120 """
@@ -122,6 +125,7 @@ def __init__(
122125 )
123126 self ._http1 = http1
124127 self ._http2 = http2
128+ self ._verify = verify
125129 self ._async_client_kwargs = async_client_kwargs
126130 self ._header_generator = header_generator
127131
@@ -219,13 +223,12 @@ def _get_client(self, proxy_url: str | None) -> httpx.AsyncClient:
219223 # Prepare a default kwargs for the new client.
220224 kwargs : dict [str , Any ] = {
221225 'transport' : _HttpxTransport (
222- proxy = proxy_url ,
223- http1 = self ._http1 ,
224- http2 = self ._http2 ,
226+ proxy = proxy_url , http1 = self ._http1 , http2 = self ._http2 , verify = self ._verify
225227 ),
226228 'proxy' : proxy_url ,
227229 'http1' : self ._http1 ,
228230 'http2' : self ._http2 ,
231+ 'verify' : self ._verify ,
229232 }
230233
231234 # Update the default kwargs with any additional user-provided kwargs.
0 commit comments