Python uses requests times wrong requests.exceptions.SSLError:HTTPSConnectionPool

Source: Internet
Author: User

Requests.exceptions.SSLError:HTTPSConnectionPool (host=' www.baidu.com ', port=443): Max retries exceeded with URL:/(Caused by Sslerror (Sslerror (1, u' [ssl:certificate_verify_failed] CERTIFICATE VERIFY FAILED (_ssl.c:581) '),))

 the error message is the above. First I looked for a lot of information, there are many people said to turn off certificate authentication (verify=False)) can solve this problem or when you do get, specify the SSL certificate. Response = Requests.get (' http://www.baidu.com/', headers = header, verify=False)
but I have not solved this problem perfectly with either of these methods, and there are some subsequent errors such as Insecurerequestwarning

Reference documentation for correct practice

Https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

Https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl

Reference Blog: http://blog.csdn.net/zahuopuboss/article/details/52964809

Just install a few requests dependency packages to fix this problem

Pip Install cryptography

Pip Install Pyopenssl

Pip Install Certifi

Go to Blog: 79013199

Python uses requests times wrong requests.exceptions.SSLError:HTTPSConnectionPool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.