This lesson is locked. Login or Subscribe for more access!

What is SSL?

Duration: 7 mins

Learn what SSL is. If you don't know, this is a must watch!

Instructor

Chris Shepherd

Share with a friend!

Transcript

In this module, we'll look at authentication in GRPC with a deep dive into the world of security with SSL and TLS. SSL or Secure Sockets Layer and its newer version TLS which is Transport Layer Security are cryptographic protocols designed to provide secure communication over the internet.

SSL or TLS use certificates to establish an encrypted link between a server and a client, allowing sensitive information to be transmitted securely over the internet, ensuring that data cannot be read or tampered with by anyone else. TLS certificates authenticate identities and enable encrypted connections through a handshake. The handshake protocol is used between a web client and a server to establish trust and negotiate what secret key should be used to encrypt and decrypt the data.

The flow looks something like this: The client requests access to a protected resource. The server responds by sending its SSL certificates, including the public key. The client verifies that the certificate is valid and trusted, ensuring the server is authentic. The client then generates a symmetric session key and encrypts it with the server's public key, securely transmitting the session key to the server. The server decrypts the session key with its private key, and both parties use the symmetric session key to encrypt and decrypt all transmitted data.

This allows the two parties to negotiate an encrypted channel without sharing sensitive information over insecure channels. This type of TLS is the standard deployment where only the server is authenticated by the client, commonly used in web browsing where the server provides a certificate as proof of identity and the client verifies it against a list of trusted authorities.

MTLS or mutual TLS extends this concept by requiring both the client and the server to authenticate each other. This is often used in environments where security needs to be higher, such as business-to-business applications or within secured microservice architectures. Mutual TLS is similar to the TLS protocol, but in MTLS, there are additional steps involved before the key exchange.

The MTLS handshake involves nine steps. First, the client initiates with a client hello message, including the highest version of TLS supported, a session ID, and supported algorithms. The server responds with a server hello, containing similar information. The server then sends its certificate, chain, and public key. The client verifies the certificate's validity using the certificate authority's public key and confirms it belongs to the intended server.

To verify server ownership, the client creates a random secret key, encrypts it with the server's public key, and sends it back. After the server decrypts this using its private key, the client sends its own certificate, chain, and public key. The server performs similar verification steps, checking the certificate's validity and ownership. Finally, the server creates a random secret key, encrypts it with the client's public key, and sends it back.

The advantages of using MTLS include enhanced security through bidirectional authentication, which is more secure compared to traditional TLS that only authenticates the server. It prevents man-in-the-middle attacks by requiring both parties to present valid certificates, making unauthorized interceptions much harder. MTLS also enables detailed access control policies based on client certificates, particularly useful in microservices architectures.

MTLS helps organizations meet stricter regulatory and compliance requirements like HIPAA for healthcare or PCI for payment data. While implementing MTLS requires managing more certificates, it centralizes and standardizes certificate management practices, enhancing overall system security.

You should use MTLS any time the server needs to ensure the authenticity of a specific client, user, or device. This includes scenarios like user authentication in applications, devices on corporate networks, CDNs or cloud security services connecting to backend servers, IoT sensors, business-to-business data exchanges, and microservice architectures where each component must ensure valid communication with the right clients.