gpt4 book ai didi

python - 如何忽略 SSL : CERTIFICATE_VERIFY_FAILED error?

转载 作者:行者123 更新时间:2023-12-01 08:51:01 36 4
gpt4 key购买 nike

遇到此错误后如何保持脚本运行?

requests.exceptions.SSLError:
HTTPSConnectionPool(host='www.funcate.org.br', port=443): Max retries exceeded with url: /pt/portal-de-compras?file=../../../index.php%250A (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:718)'),))

最佳答案

您可以通过将 verify=False 作为额外参数传递给 requests.get() 函数来关闭 SSL 证书验证:

response = requests.get('https://foobar.com.br/', verify=False)

请注意,这将使您容易受到各种 man in the middle attacks 的影响。 。使用 SSL 证书是有原因的 :-) 尽管我意识到您不一定能够强制执行这一点。

关于python - 如何忽略 SSL : CERTIFICATE_VERIFY_FAILED error?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53123565/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com