During the TLS handshake, the client verifies the authenticity of a server's public key using a combination of asymmetric encryption, digital certificates, and a trusted third party called a Certificate Authority (CA). This process ensures that the client is communicating securely with the intended server and not an imposter.
When the client initiates a TLS handshake with a server, the server sends its public key to the client. The client then needs to verify that this public key actually belongs to the intended server and has not been tampered with by an attacker.
To achieve this, the server's public key is typically embedded in a digital certificate. A digital certificate is a data structure that contains the public key, information about the server, and is signed by a trusted CA. The CA acts as a trusted third party that vouches for the authenticity of the server's public key.
During the handshake, the client receives the server's digital certificate. It then performs the following steps to verify the authenticity of the server's public key:
1. Extract the public key: The client extracts the public key from the received digital certificate.
2. Verify the CA's signature: The client uses the CA's public key, which is typically pre-installed in the client's trust store, to verify the signature on the digital certificate. This ensures that the certificate has not been tampered with and is indeed issued by a trusted CA.
3. Validate the certificate chain: The client checks if the digital certificate is part of a valid certificate chain. The chain includes the server's certificate, any intermediate CA certificates, and the root CA certificate. Each certificate in the chain is validated using the public key of the issuing CA. This process ensures that the server's certificate is issued by a trusted CA and has not been fraudulently obtained.
4. Check certificate revocation status: The client checks if the server's certificate has been revoked by the CA. This is done by verifying the certificate's revocation status against a Certificate Revocation List (CRL) or an Online Certificate Status Protocol (OCSP) response. If the certificate is revoked, the client rejects it.
5. Verify server identity: The client compares the server's identity, typically in the form of its domain name, with the information in the digital certificate. This step ensures that the client is communicating with the intended server and not an imposter.
If all the above steps are successfully completed, the client can be confident that the server's public key is authentic and can proceed with the TLS handshake. The subsequent communication will be encrypted using the server's public key, ensuring confidentiality and integrity.
The client verifies the authenticity of a server's public key during the TLS handshake by validating the digital certificate, verifying the CA's signature, validating the certificate chain, checking the certificate revocation status, and verifying the server's identity. This multi-step process ensures secure communication between the client and the server.
Other recent questions and answers regarding EITC/IS/WASF Web Applications Security Fundamentals:
- Does implementation of Do Not Track (DNT) in web browsers protect against fingerprinting?
- Does HTTP Strict Transport Security (HSTS) help to protect against protocol downgrade attacks?
- How does the DNS rebinding attack work?
- Do stored XSS attacks occur when a malicious script is included in a request to a web application and then sent back to the user?
- Is the SSL/TLS protocol used to establish an encrypted connection in HTTPS?
- What are fetch metadata request headers and how can they be used to differentiate between same origin and cross-site requests?
- How do trusted types reduce the attack surface of web applications and simplify security reviews?
- What is the purpose of the default policy in trusted types and how can it be used to identify insecure string assignments?
- What is the process for creating a trusted types object using the trusted types API?
- How does the trusted types directive in a content security policy help mitigate DOM-based cross-site scripting (XSS) vulnerabilities?
View more questions and answers in EITC/IS/WASF Web Applications Security Fundamentals

