QPython SSL: NO_CIPHERS_AVAILABLE ERROR

在使用 QPython 3H 的 requests 库时,发生了类似如下错误:

raise SSLError(e, request=request)
reqeusts.exceptions.SSLError: HTTPSConnectionPool(host='run.glot.io', port=443): Max retries exceeded with url: /languages/python/latest (Caused by SSLError(SSLError(1, '[SSL: NO_CIPHERS_AVAILABLE] no chiphers available (_ssl.c:841)'),))

最后发现是 QPython 所用 openssl 的一个已知 bug 。需要在 import 后添加一句语句来临时解决:

import requests
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = "TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:ECDHE:!COMPLEMENTOFDEFAULT"

by SDUST weilinfox

原文地址:https://www.cnblogs.com/weilinfox/p/13769291.html