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

- **ID:** `python/pip-index-url-ssl-hostname-mismatch`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

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
   ```

## 无效尝试

- **** — pip refuses plain HTTP by default and warns/ignores the index. (70% 失败率)
- **** — Breaks other HTTPS connections and security. (90% 失败率)
