python config_error ai_generated true

警告:位于 internal-pypi.local 的仓库不是受信任或安全的主机,已被忽略。

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

其他格式: JSON · Markdown 中文 · English
80%修复率
84%置信度
0证据数
2025-04-11首次发现

版本兼容性

版本状态引入弃用备注
3.x active

根因分析

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

English

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

generic

解决方案

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

无效尝试

常见但无效的做法:

  1. 70% 失败

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

  2. 90% 失败

    Breaks other HTTPS connections and security.