python config_error ai_generated true

WARNING: The repository located at internal-pypi.local is not a trusted or secure host and is being ignored.

ID: python/pip-index-url-ssl-hostname-mismatch

Also available as: JSON · Markdown · 中文
80%Fix Rate
84%Confidence
0Evidence
2025-04-11First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active

Root Cause

Using an HTTP or self-signed internal index without configuring pip to trust it.

generic

中文

使用 HTTP 或自签名的内部索引,但未配置 pip 信任它。

Workarounds

  1. 90% success
    cat > ~/.pip/pip.conf <<'EOF'
    [global]
    index-url = https://internal-pypi.local/simple
    trusted-host = internal-pypi.local
    EOF
    pip install foo
  2. 85% success
    export PIP_CERT=/path/to/ca.pem
    pip install --index-url https://internal-pypi.local/simple foo

Dead Ends

Common approaches that don't work:

  1. 70% fail

    pip refuses plain HTTP by default and warns/ignores the index.

  2. 90% fail

    Breaks other HTTPS connections and security.