# httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败：无法获取本地颁发者证书 (_ssl.c:1123)，连接到'https://internal.example.com'时

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

## 根因

服务器的证书链不完整或本地未安装CA证书。

## 版本兼容性

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

## 解决方案

1. **Install the missing CA certificate in the system trust store** (90% 成功率)
   ```
   # On Linux: sudo cp ca.crt /usr/local/share/ca-certificates/ && sudo update-ca-certificates
# Then use httpx normally
   ```
2. **Provide the CA certificate file via the verify parameter** (85% 成功率)
   ```
   httpx.get('https://internal.example.com', verify='/path/to/ca.crt')
   ```

## 无效尝试

- **Disabling SSL verification entirely** — Compromises security and does not address the missing CA. (70% 失败率)
- **Using a different SSL library** — The issue is with the certificate, not the library. (90% 失败率)
