2
2
3
3
import contextlib
4
4
import os
5
+ import ssl
5
6
import warnings
6
7
from http .cookiejar import CookieJar
7
8
from pathlib import Path
22
23
import httpx
23
24
from httpx import Response
24
25
from httpx import Timeout
25
- from httpx ._types import VerifyTypes
26
26
from pydantic import BaseModel
27
27
from pydantic import SecretStr
28
28
from pydantic import ValidationError
@@ -184,7 +184,7 @@ def __init__(
184
184
# HTTPX client options
185
185
follow_redirects : bool = True ,
186
186
timeout : Union [float , Timeout ] = 10.0 ,
187
- verify : VerifyTypes = True ,
187
+ verify : Union [ ssl . SSLContext , str , bool ] = True ,
188
188
# Retry options
189
189
retry : Optional [RetrySettings ] = RetrySettings (), # type: ignore[call-arg]
190
190
** kwargs : Any ,
@@ -226,10 +226,10 @@ def __init__(
226
226
timeout : Union[float, Timeout]
227
227
The timeout to use for requests.
228
228
Can be either a float or a `httpx.Timeout` object.
229
- verify : VerifyTypes
229
+ verify : Union[ssl.SSLContext, str, bool]
230
230
Control verification of the server's TLS certificate.
231
- See `httpx._types.VerifyTypes` for more information or
232
- <https://www.python-httpx.org/advanced/ssl/> .
231
+ Can be an SSL context, a path to a CA bundle, or a boolean.
232
+ Defaults to True .
233
233
**kwargs : Any
234
234
Backwards-compatibility with deprecated parameters.
235
235
Unknown kwargs are ignored.
@@ -271,7 +271,7 @@ def authenticate(
271
271
basicauth : Optional [str ] = None ,
272
272
credentials_file : Optional [Union [str , Path ]] = None ,
273
273
url : Optional [str ] = None ,
274
- verify : Optional [VerifyTypes ] = None ,
274
+ verify : Optional [Union [ ssl . SSLContext , str , bool ] ] = None ,
275
275
** kwargs : Any ,
276
276
) -> None :
277
277
"""(Re-)Authenticate the client with the provided credentials.
@@ -291,7 +291,7 @@ def authenticate(
291
291
`username`, `secret` and `basicauth` must not be provided if this is used.
292
292
url : Optional[str]
293
293
The URL of the Harbor server in the format `http://host:[port]/api/v<version>`
294
- verify : Optional[VerifyTypes ]
294
+ verify : Optional[Union[ssl.SSLContext, str, bool] ]
295
295
Control verification of the server's TLS certificate.
296
296
**kwargs : Any
297
297
Additional keyword arguments to pass in.
0 commit comments