mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
Update handling of 'litellm.ssl_verify' in HTTP handlers to allow for custom, self-signed certificates.
This commit is contained in:
parent
e747127e3b
commit
765e020e75
2 changed files with 23 additions and 9 deletions
|
|
@ -111,7 +111,7 @@ common_cloud_provider_auth_params: dict = {
|
|||
"providers": ["vertex_ai", "bedrock", "watsonx", "azure", "vertex_ai_beta"],
|
||||
}
|
||||
use_client: bool = False
|
||||
ssl_verify: bool = True
|
||||
ssl_verify: Union[str, bool] = True
|
||||
ssl_certificate: Optional[str] = None
|
||||
disable_streaming_logging: bool = False
|
||||
in_memory_llm_clients_cache: dict = {}
|
||||
|
|
|
|||
|
|
@ -35,11 +35,18 @@ class AsyncHTTPHandler:
|
|||
self, timeout: Optional[Union[float, httpx.Timeout]], concurrent_limit: int
|
||||
) -> httpx.AsyncClient:
|
||||
|
||||
# Check if the HTTP_PROXY and HTTPS_PROXY environment variables are set and use them accordingly.
|
||||
ssl_verify = bool(os.getenv("SSL_VERIFY", litellm.ssl_verify))
|
||||
# SSL certificates (a.k.a CA bundle) used to verify the identity of requested hosts.
|
||||
# /path/to/certificate.pem
|
||||
ssl_verify = os.getenv(
|
||||
"SSL_VERIFY",
|
||||
litellm.ssl_verify
|
||||
)
|
||||
# An SSL certificate used by the requested host to authenticate the client.
|
||||
# /path/to/client.pem
|
||||
cert = os.getenv(
|
||||
"SSL_CERTIFICATE", litellm.ssl_certificate
|
||||
) # /path/to/client.pem
|
||||
"SSL_CERTIFICATE",
|
||||
litellm.ssl_certificate
|
||||
)
|
||||
|
||||
if timeout is None:
|
||||
timeout = _DEFAULT_TIMEOUT
|
||||
|
|
@ -212,11 +219,18 @@ class HTTPHandler:
|
|||
if timeout is None:
|
||||
timeout = _DEFAULT_TIMEOUT
|
||||
|
||||
# Check if the HTTP_PROXY and HTTPS_PROXY environment variables are set and use them accordingly.
|
||||
ssl_verify = bool(os.getenv("SSL_VERIFY", litellm.ssl_verify))
|
||||
# SSL certificates (a.k.a CA bundle) used to verify the identity of requested hosts.
|
||||
# /path/to/certificate.pem
|
||||
ssl_verify = os.getenv(
|
||||
"SSL_VERIFY",
|
||||
litellm.ssl_verify
|
||||
)
|
||||
# An SSL certificate used by the requested host to authenticate the client.
|
||||
# /path/to/client.pem
|
||||
cert = os.getenv(
|
||||
"SSL_CERTIFICATE", litellm.ssl_certificate
|
||||
) # /path/to/client.pem
|
||||
"SSL_CERTIFICATE",
|
||||
litellm.ssl_certificate
|
||||
)
|
||||
|
||||
if client is None:
|
||||
# Create a client with a connection pool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue