python
network_error
ai_generated
partial
httpx.ConnectError: [SSL: SSL_HANDSHAKE_FAILURE] ssl handshake failure (_ssl.c:1123) while connecting to 'https://incompatible.example.com'
ID: python/httpx-connecterror-ssl-handshake-failure
80%Fix Rate
87%Confidence
0Evidence
2025-12-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The client and server cannot agree on SSL/TLS parameters, often due to outdated protocols or cipher mismatches.
generic中文
客户端和服务器无法就SSL/TLS参数达成一致,通常是由于过时的协议或密码套件不匹配。
Workarounds
-
90% success Update the server to support modern TLS versions (1.2 or 1.3)
Contact server administrator to enable TLS 1.2 or higher.
-
80% success Configure the client to use a specific TLS version if supported
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')
Dead Ends
Common approaches that don't work:
-
Disabling SSL verification
80% fail
Handshake failure occurs before certificate verification.
-
Using a very old SSL version
70% fail
Old versions are often disabled for security reasons.