# httpx.ConnectError: [SSL: SSL_HANDSHAKE_FAILURE] SSL握手失败 (_ssl.c:1123)，连接到'https://incompatible.example.com'时

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

## 根因

客户端和服务器无法就SSL/TLS参数达成一致，通常是由于过时的协议或密码套件不匹配。

## 版本兼容性

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

## 解决方案

1. **Update the server to support modern TLS versions (1.2 or 1.3)** (90% 成功率)
   ```
   Contact server administrator to enable TLS 1.2 or higher.
   ```
2. **Configure the client to use a specific TLS version if supported** (80% 成功率)
   ```
   import ssl
context = ssl.create_default_context()
context.minimum_version = ssl.TLSVersion.TLSv1_2
client = httpx.Client(verify=context)
response = client.get('https://incompatible.example.com')
   ```

## 无效尝试

- **Disabling SSL verification** — Handshake failure occurs before certificate verification. (80% 失败率)
- **Using a very old SSL version** — Old versions are often disabled for security reasons. (70% 失败率)
