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
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.
解决方案
-
90% 成功率
cat > ~/.pip/pip.conf <<'EOF' [global] index-url = https://internal-pypi.local/simple trusted-host = internal-pypi.local EOF pip install foo
-
85% 成功率
export PIP_CERT=/path/to/ca.pem pip install --index-url https://internal-pypi.local/simple foo
无效尝试
常见但无效的做法:
-
70% 失败
pip refuses plain HTTP by default and warns/ignores the index.
-
90% 失败
Breaks other HTTPS connections and security.