修改自签证书验证总是通过问题

This commit is contained in:
fumingwei
2020-10-27 23:08:04 +08:00
parent 704137436d
commit 6d0631a197

View File

@@ -169,7 +169,8 @@ class SslInterceptRequestBuild:
else:
raise Exception("Error: Ssl connection is intercept, cert maybe trust, cert info: %s" % issuer[1])
else:
if re.search(r'\bCN[\s]*=[\s]*BadSSL\b',issuer[1],0):
if re.search(r'\bCN[\s]*=[\s]*BadSSL\b',issuer[1],0) or \
re.search(r'\bCN[\s\S]*=[\s\S]*badssl[\s\S]*',issuer[1],0):
raise Exception("Error: Ssl connection intercept failed, cert info: %s" % issuer[1])
else:
raise Exception(sec_info_re)