Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions osv-scanner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ id = "GHSA-vfj7-8cjw-p6xm"
ignoreUntil = 2026-11-03
reason = "braces has no fixed release published (3.0.3, 2024-05-21, is latest and last_affected); dev-only via knip > fast-glob > micromatch; remove this entry once one exists"

[[IgnoredVulns]]
id = "GHSA-6q48-6c7w-9gw2"
ignoreUntil = 2026-10-23
reason = "certifi 2026.10.19 (published 2026-10-20) is inside the 3-day uv exclude-newer window until 2026-10-23 02:24 UTC; bump certifi and remove this entry once it clears"

[[PackageOverrides]]
name = "pillow"
version = "12.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packaging/litellm-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"pydantic>=2.14.0,<3.0.0; python_version >= '3.15'",
"pydantic-settings>=2.14.1,<3.0",
"jsonschema>=4.0.0,<5.0",
"certifi>=2026.10.19",
"certifi>=2026.10.23",
"typing-extensions>=4.13.0,<5.0",
]

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies = [
"pydantic-settings>=2.14.1,<3.0",
"jsonschema>=4.0.0,<5.0",
"boto3>=1.43.117,<2.0",
"certifi>=2026.10.19",
"certifi>=2026.10.23",
"typing-extensions>=4.13.0,<5.0",
]

Expand Down
2 changes: 1 addition & 1 deletion tests/code_coverage_tests/liccheck.ini
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ langgraph: >=1.0.10 # MIT License
langgraph-prebuilt: >=1.0.8 # MIT License - https://github.com/langchain-ai/langgraph/blob/main/LICENSE
hypothesis: >=6.165.10 # MPL 2.0 license
pytest-rerunfailures: >=15.1 # MPL 2.0 license
certifi: >=2026.10.19 # MPL 2.0 license - https://github.com/certifi/python-certifi/blob/master/LICENSE
certifi: >=2026.10.23 # MPL 2.0 license - https://github.com/certifi/python-certifi/blob/master/LICENSE
pytest-recording: >=0.13.4 # MIT license
expression: >=5.6.0 # MIT License - https://github.com/cognitedata/Expression/blob/main/LICENSE
typing-extensions: >=4.13.0 # PSF-2.0 license - https://github.com/python/typing_extensions/blob/main/LICENSE
Expand Down
36 changes: 28 additions & 8 deletions tests/unit/llms/custom_httpx/test_http_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import weakref
from collections.abc import Callable, Mapping
from concurrent.futures import ThreadPoolExecutor
from itertools import chain
from typing import Final
from unittest.mock import MagicMock, patch

Expand All @@ -16,6 +17,8 @@
import pytest
import respx
from aiohttp import ClientSession, TCPConnector
from cryptography import x509
from cryptography.x509.oid import NameOID

import litellm
from litellm.caching.llm_caching_handler import LLMClientCache
Expand Down Expand Up @@ -296,10 +299,7 @@ def test_get_ssl_configuration():
when no environment variables are set."""
from litellm.llms.custom_httpx.http_handler import _ssl_context_cache

# Clear cache to ensure ssl.create_default_context is called
_ssl_context_cache.clear()

with patch.dict(os.environ, clear=True):
with patch.dict(_ssl_context_cache, clear=True), patch.dict(os.environ, clear=True):
with patch("ssl.create_default_context") as mock_create_context:
# Mock the return value
mock_ssl_context = MagicMock(spec=ssl.SSLContext)
Expand Down Expand Up @@ -331,6 +331,29 @@ def test_get_ssl_configuration_integration():
assert ssl_context.verify_mode is not None


EMSIGN_ROOTS_REMOVED_FROM_CERTIFI: Final = frozenset({"emSign Root CA - C1", "emSign ECC Root CA - C3"})
EMSIGN_ROOTS_REMOVED_FROM_CERTIFI_SOURCE: Final = "certifi 2026.10.23 dropped both roots, certifi/python-certifi#445"


def _trusted_common_names(ssl_context: ssl.SSLContext) -> frozenset[str]:
certificates: Final = (x509.load_der_x509_certificate(der) for der in ssl_context.get_ca_certs(binary_form=True))
common_names: Final = chain.from_iterable(
certificate.subject.get_attributes_for_oid(NameOID.COMMON_NAME) for certificate in certificates
)
return frozenset(str(attribute.value) for attribute in common_names)


def test_default_ssl_context_does_not_trust_emsign_roots_removed_from_certifi(
monkeypatch: pytest.MonkeyPatch,
) -> None:
monkeypatch.delenv("SSL_CERT_FILE", raising=False)
ssl_context: Final = get_ssl_configuration(ssl_verify=True)
assert isinstance(ssl_context, ssl.SSLContext)
trusted: Final = _trusted_common_names(ssl_context)
assert trusted, "the default SSL context loaded no CA certificates"
assert trusted.isdisjoint(EMSIGN_ROOTS_REMOVED_FROM_CERTIFI), EMSIGN_ROOTS_REMOVED_FROM_CERTIFI_SOURCE


# Session Reuse Tests
class MockClientSession:
"""Mock ClientSession that is not callable"""
Expand Down Expand Up @@ -526,10 +549,7 @@ def test_ssl_ecdh_curve(env_curve, litellm_curve, expected_curve, should_call, m
"""Test SSL ECDH curve configuration with valid curves and precedence"""
from litellm.llms.custom_httpx.http_handler import _ssl_context_cache

# Clear cache to ensure fresh SSL context creation
_ssl_context_cache.clear()

with patch.dict(os.environ, clear=True):
with patch.dict(_ssl_context_cache, clear=True), patch.dict(os.environ, clear=True):
if env_curve:
monkeypatch.setenv("SSL_ECDH_CURVE", env_curve)

Expand Down
8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading