Request sends an HTTPS request (handles SSL certificate validation)

Source: Internet
Author: User
Tags ssl certificate

1. What is SSL and why does it require certificate validation when sending HTTPS requests?

1.1 SSL: Secure Sockets Layer. is to solve the HTTP protocol is clear text, to avoid the transmission of data stolen, tampering, hijacking and so on.

1.2 Tsl:transport layer Security, Transport Layer secure protocol. TSL is actually the product of SSL standardization, namely SSL/TSL

is actually a thing.

1.3 Https:https is HTTP-compatible and can be interpreted as ' http over TSL ', which means HTTPS is the HTTP protocol

And a combination of the TSL protocol.

1.4 HTTPS when transmitting data, the same will establish a TCP connection, after establishing a TCP connection, will establish a TSL connection, this process can

By grasping the package view:

Which layer of the network 7 layer structure is the 1.5 SSL protocol? Some information directly indicates that the SSL protocol is in the transport layer,

Some data say that the SSL protocol is between the transport layer and the application layer.

1.6 Requests can validate SSL certificates for HTTPS requests, just like Web browsers, where SSL authentication is turned on by default,

If the certificate validation fails, the request throws Sslerror:

>>>import Requests

>>>requests.get (' https:xxxx.com ') #发起一个https请求

>>>requests.exceptions.sslerror:xxx

1.7 encountered the request of SSL authentication, you can skip the non-authentication directly, the Verify=false set a bit.

The official documentation is explained below:

2. Ignore warnings

2.1 After you ignore the validation settings, you can skip SSL authentication, but there is a warning message insecurerequestwarning.

Here's how to ignore the warning message:

Summarize:

1.HTTPS requests SSL authentication or ignores SSL authentication to request success, ignoring the wayverify=False。

2.SSL certificates are issued by CA agencies, so security is also for money

3. To fully understand the HTTP protocol, not only to distinguish the level of HTTP get,post and other actions, but also to understand the 7 layer

protocols used in each layer of the network structure, and the process of data transfer

Request sends an HTTPS request (handles SSL certificate validation)

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.