BerriAI/litellm · error · ValueError
advisor tool definition sets 'api_base' but the proxy has TL
Error message
advisor tool definition sets 'api_base' but the proxy has TLS verification disabled (litellm.ssl_verify=False), so a caller-supplied api_base can't be safely validated against DNS rebinding.
What it means
Third guard in the advisor credential chain: a caller-supplied api_base is refused when litellm.ssl_verify is False. With TLS verification disabled, certificate validation cannot block DNS-rebinding attacks against the https-scheme check, so the resolver refuses the combination rather than ship an unsafe path. Note disabling ssl_verify globally also disables this feature.
Source
Thrown at litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py:223
``anthropic_messages()`` call chain.
"""
if not _allow_client_side_advisor_credentials():
return None, None
api_key: Final[str | None] = advisor_tool.get("api_key")
api_base: Final[str | None] = advisor_tool.get("api_base")
if api_base is None:
return api_key, None
if not api_key:
raise ValueError(
"advisor tool definition sets 'api_base' without 'api_key'. A "
"caller-supplied api_base is only honored alongside a "
"caller-supplied api_key, so the proxy's own credentials are "
"never sent to a caller-chosen destination."
)
if not api_base.startswith("https://"):
raise ValueError(f"advisor tool definition sets 'api_base'={api_base!r}, which must use the https scheme.")
if getattr(litellm, "ssl_verify", True) is False:
raise ValueError(
"advisor tool definition sets 'api_base' but the proxy has TLS verification "
"disabled (litellm.ssl_verify=False), so a caller-supplied api_base can't be "
"safely validated against DNS rebinding."
)
if getattr(litellm, "user_url_validation", True):
validate_url(api_base)
return api_key, api_base
def _make_synthetic_advisor_tool() -> dict:
"""Build a regular tool definition the executor provider can understand."""
return {
"name": "advisor",
"description": ADVISOR_TOOL_DESCRIPTION,
"input_schema": {
"type": "object",
"properties": {
"question": {View on GitHub (pinned to 6c2dcb801b)
Solutions
- Re-enable TLS verification (remove litellm.ssl_verify = False) and add the internal CA / self-signed cert to the trust store (e.g. via REQUESTS_CA_BUNDLE or SSL_CERT_FILE).
- Or terminate TLS properly for the destination with a publicly trusted cert.
- Or move the destination into server-side proxy config where credentials are gateway-owned, avoiding caller-supplied api_base entirely.
Example fix
# before import litellm litellm.ssl_verify = False # breaks caller-supplied advisor api_base # after import os os.environ["REQUESTS_CA_BUNDLE"] = "/path/to/internal-ca.pem" # trust the internal CA instead
Defensive patterns
Strategy: validation
Validate before calling
import litellm
def advisor_custom_base_allowed() -> bool:
return getattr(litellm, "ssl_verify", True) is not False Type guard
def advisor_config_is_safe(advisor_tool: dict, ssl_verify: bool = True) -> bool:
api_base = advisor_tool.get("api_base")
if api_base is None:
return True
return ssl_verify and api_base.startswith("https://") and bool(advisor_tool.get("api_key")) Try / catch
try:
resp = litellm.anthropic_messages(tools=tools, ...)
except ValueError as e:
if "TLS verification disabled" in str(e):
return http_error(400, "caller-supplied api_base requires ssl_verify=True")
raise Prevention
- Never run litellm.ssl_verify=False in production; trust internal CAs via REQUESTS_CA_BUNDLE instead.
- Feature-detect: if ssl_verify is disabled, drop caller-supplied api_base support.
- Alert on any deployment config combining ssl_verify=False with advisor custom bases.
When it happens
Trigger: Advisor tool with api_base (https) and api_key, while the process runs with litellm.ssl_verify = False (commonly set to tolerate self-signed certificates in dev). getattr(litellm, 'ssl_verify', True) is False and the ValueError fires.
Common situations: Dev environments with self-signed certs where developers set litellm.ssl_verify=False as a workaround; CI pipelines that disable verification globally; the same flag set to work with other self-signed providers breaking advisor custom bases.
Understand the failure class
- SSL/TLS and certificate errors — how TLS handshakes and certificate validation fail.
Related errors
- advisor tool definition sets 'api_base' without 'api_key'. A
- advisor tool definition sets 'api_base'={api_base!r}, which
- URL targets a blocked address ({resolved_ip}). If this is a
- Advisor tool must have a valid model
- advisor tool definition must include a 'model' field specify
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/0ce0b41c17854940.
Report an issue: GitHub.