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)