参考:https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
urllib3 will issue several different warnings based on the level of certificate verification support. These warnings indicate particular situations and can be resolved in different ways.
InsecureRequestWarningThis happens when a request is made to an HTTPS URL without certificate verification enabled. Follow the certificate verification guide to resolve this warning.
InsecurePlatformWarningThis happens on Python 2 platforms that have an outdated
sslmodule. These oldersslmodules can cause some insecure requests to succeed where they should fail and secure requests to fail where they should succeed. Follow the pyOpenSSL guide to resolve this warning.
SNIMissingWarningThis happens on Python 2 versions older than 2.7.9. These older versions lack SNI support. This can cause servers to present a certificate that the client thinks is invalid. Follow the pyOpenSSL guide to resolve this warning.
Making unverified HTTPS requests is strongly discouraged, however, if you understand the risks and wish to disable these warnings, you can use disable_warnings():
>>> import urllib3
>>> urllib3.disable_warnings()
没有评论:
发表评论