# requests.exceptions.SSLError: HTTPSConnectionPool(host='expired.example.com', port=443): 超过最大重试次数 (由SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败：证书已过期'))引起)

- **ID:** `python/requests-sslerror-expired-certificate`
- **领域:** python
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

服务器的SSL证书已过期，不再有效。

## 版本兼容性

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

## 解决方案

1. **Renew the certificate on the server side** (95% 成功率)
   ```
   Contact server administrator to renew the SSL certificate.
   ```
2. **Use a different endpoint or service that has a valid certificate** (80% 成功率)
   ```
   requests.get('https://valid.example.com')
   ```

## 无效尝试

- **Setting verify=False to bypass the error** — Bypasses security but exposes to risks; does not fix the expired certificate. (60% 失败率)
- **Using a custom CA bundle with the expired certificate** — The certificate is expired, so it will still fail verification. (90% 失败率)
