不知道从那个版本起,python用urlopen打开一个https时会验证一次 SSL 证书,当目标使用的是自签名的证书时就会爆出一个 

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)>

解决办法是:通过导入ssl模块,把证书验证关了

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

 

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2021-09-17
  • 2021-11-25
  • 2021-12-27
  • 2021-12-08
  • 2021-11-24
  • 2021-10-20
猜你喜欢
  • 2021-10-12
  • 2021-11-27
  • 2022-02-12
  • 2021-10-12
  • 2022-12-23
  • 2021-10-23
  • 2022-01-23
相关资源
相似解决方案