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)

posted @ 2018-05-14 18:47  周零开  阅读(0)  评论(0)    收藏  举报