Symptom
On the same machine,curl against api.apiyi.com works fine, but a Python program (especially in a Conda environment) fails with:
Short Answer
This is not an APIYI server-side issue and not a certificate issue. Your OpenSSL version is incompatible with a middlebox on your network. Compare the OpenSSL versions on both sides:Why It Happens
Starting with OpenSSL 3.5, the TLS handshake includes a post-quantum key exchange (X25519MLKEM768) by default. That grows the first handshake message (ClientHello) from about 300 bytes to about 1500 bytes, larger than a single TCP segment, so it has to be split into two segments. Some corporate firewalls, TLS inspection appliances, and ISP-side deep packet inspection devices cannot handle a split ClientHello, or do not recognize the new key exchange algorithm, and simply close the connection. The client sees “EOF occurred in violation of protocol”. Every APIYI edge node supports this post-quantum handshake. On 2026-09-11 (UTC+8) we verified each node with OpenSSL 3.6.4 and all of them passed. The handshake packet is being dropped inside your network before it reaches us, so nothing on the server side can fix it for you.Three Commands to Confirm
Run these with theopenssl binary from the failing environment (activate the Conda environment first):
Fixes (pick one)
Option 1: Disable post-quantum key exchange via a config file (recommended)
~/no-pq.cnf:Option 2: Downgrade OpenSSL in Conda
Option 3: Ask your network team to update the middlebox
Follow-up Questions
Why does the browser open api.apiyi.com while my program cannot?
Why does the browser open api.apiyi.com while my program cannot?
Can Node.js, Go or Java hit this too?
Can Node.js, Go or Java hit this too?
Does connecting by IP or setting verify=False help?
Does connecting by IP or setting verify=False help?
Can APIYI turn off post-quantum handshakes on the server?
Can APIYI turn off post-quantum handshakes on the server?