python requires模块 https请求 由于TLS协议版本太高导致错误

错误提示

requests.exceptions.SSLError: HTTPSConnectionPool(host='air.cnemc.cn', port=18007): Max retries exceeded with url: /emcpublish/ClientBin/Env-CnemcPublish-RiaServices-EnvCnemcPublishDomainService.svc/binary/GetAQIDataPublishLives (Caused by SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:897)'),))

  

解决办法:

centos系统中

vim /etc/crypto-policies/back-ends/opensslcnf.config

MinProtocol = TLSv1.2

修改为

MinProtocol = TLSv1.0

完美解决.

原文地址:https://www.cnblogs.com/objects/p/15127971.html