Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the SSL certificate verification method of Python requests?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "Python requests SSL certificate verification method is what", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "Python requests SSL certificate verification method is what" it!

SSL certificate verification for requests 1. For HTTPS

SSL authentication is enabled by default, and failure to verify SSL certificates results in:

Requests.exceptions.SSLError: ("bad handshake: Error ([('SSL routines',' tls_process_server_certificate', 'certificate verify failed')],)",)

Solution:

# add verify=Falseres = requests.get (ur,verify=False) 2 to requests. After the above steps, a warning will appear

InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)

Solution:

From requests.packages.urllib3.exceptions import InsecureRequestWarning# disable Security request warning requests.packages.urllib3.disable_warnings (InsecureRequestWarning) requests handles untrusted ssl certificates do not validate SSL certificate requests.get (url,verify=False)

The previous 12306 certificate was not authenticated

For https protocol

There will be an encryption authentication for the ssl certificate

Thank you for your reading, these are the contents of "what is Python requests's SSL certificate verification method?" after the study of this article, I believe you have a deeper understanding of what Python requests's SSL certificate verification method is, and the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report