Openssl and python urllib.request.urlopen fails, how to fix it?

I run behind Cloudflare and my local nginx, it works fine in browser.
However, when I use openssl s_client -connect, it shows:
140682642245272:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:769:

no peer certificate available

No client certificate CA names sent

SSL handshake has read 7 bytes and written 305 bytes

New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Protocol : TLSv1
Cipher : 0000
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1543940761
Timeout : 300 (sec)
Verify return code: 0 (ok)

and when I use urllib.request.urlopen(""), it shows:

urllib.error.URLError: <urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1045)>
['HTTPError: HTTP Error 403: Forbidden', '  File "python3.7/", line 90, in runcode', '  File "<console>", line 1, in <module>', '  File "urllib/", line 222, in urlopen', '  File "urllib/", line 531, in open', '  File "urllib/", line 641, in http_response', '  File "urllib/", line 569, in error', '  File "urllib/", line 503, in _call_chain', '  File "urllib/", line 649, in http_error_default']

I don’t know how to fix it.

Sounds like you need to update your openssl client.

This topic was automatically closed after 30 days. New replies are no longer allowed.