python ssl SSLError(CertificateError("hostname '192.168.1.223' doesn't match 'test.xxx.org'"

证书不匹配问题

SSLError(CertificateError("hostname '192.168.1.223' doesn't match 'test.xxx.org'"


1.对于python自带的 urllib库  解决办法

    

import ssl
ssl.match_hostname = lambda cert, hostname: True

2. 对于requests 库,解决办法

    

requests.get(url='https://192.168.1.223',verify=False)

猜你喜欢

转载自blog.csdn.net/onionnmmn/article/details/80312953