# 错误：由于OSError无法安装包：HTTPS连接池超过最大重试次数（由SSLError引起：证书验证失败：无法获取本地颁发者证书）

- **ID:** `python/pip-ssl-certificate-verify-failed`
- **领域:** python
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

由于系统缺少或CA证书过期，SSL证书验证失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.10 | active | — | — |

## 解决方案

1. **Update CA certificates** (90% 成功率)
   ```
   pip install --upgrade certifi
# Or system level: sudo update-ca-certificates
   ```
2. **Use a custom CA bundle if behind corporate proxy** (85% 成功率)
   ```
   pip install --cert /path/to/custom-ca-bundle.crt package
   ```

## 无效尝试

- **Disabling SSL verification with --trusted-host** — Security risk; may work but exposes to man-in-the-middle attacks. (30% 失败率)
- **Using --cert with wrong path** — Path to certificate may be incorrect or file missing. (70% 失败率)
