When a client (e.g., a web browser) establishes a secure HTTPS connection with a server, the following steps occur to ensure the security of the communication:
-
The client initiates the HTTPS connection by requesting a secure resource from the server, typically by entering a URL that begins with "https://".
-
The server responds by sending its SSL/TLS certificate to the client, which contains the server's public key and other identifying information.
-
The client verifies the certificate by checking that it has been signed by a trusted Certificate Authority (CA) and that the domain name in the certificate matches the domain name in the URL.
-
The client generates a random symmetric key to use for encryption and sends it to the server, encrypted with the server's public key.
-
The server decrypts the symmetric key using its private key and sends an acknowledgement to the client that the key exchange is complete.
-
The client and server now use the symmetric key to encrypt and decrypt all data that is transmitted between them for the remainder of the session.
-
At the end of the session, the client and server both delete the symmetric key and the secure connection is terminated.
This process ensures that all data transmitted between the client and server is encrypted using a shared secret key that is known only to the two parties, making it very difficult for an attacker to intercept and read the data. The use of public-key cryptography to securely exchange the symmetric key ensures that the key exchange itself is also secure.
标签:加密,https,网站,server,symmetric,client,key,public,secure From: https://www.cnblogs.com/chucklu/p/17284087.html