openssl版本判断的修改

This commit is contained in:
Womsxd 2021-06-18 21:41:30 +08:00
parent 3b12170d00
commit e488210f3b
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68
2 changed files with 8 additions and 2 deletions

View File

@ -4,7 +4,7 @@ try:
http = httpx
#当openssl版本小于1.0.2的时候直接进行一个空请求让httpx报错
import tools
if tools.Get_openssl_Version() < 102:
if tools.Get_openssl_Version() <= 102:
httpx.get()
except:
import requests

View File

@ -1,5 +1,4 @@
import os
import ssl
import uuid
import time
import config
@ -67,5 +66,12 @@ def Nextday() -> int:
#获取Openssl版本
def Get_openssl_Version() ->int:
try:
import ssl
except ImportError:
log.error("Openssl Lib Error !!")
#return -99
#建议直接更新Python的版本有特殊情况请提交issues
exit(-1)
temp_List = ssl.OPENSSL_VERSION_INFO
return int(f"{str(temp_List[0])}{str(temp_List[1])}{str(temp_List[2])}")