System Weakness

System Weakness is a publication that specialises in publishing upcoming writers in cybersecurity and ethical hacking space. Our security experts write to make the cyber universe more secure, one vulnerability at a time.

Follow publication

Understanding Mutual TLS (mTLS): A Secure Connection

Roopa Kushtagi
System Weakness
Published in
4 min readSep 7, 2023

Several topics like this are discussed on my YouTube channel. Please visit. I appreciate your support.

Introduction

Mutual Transport Layer Security (mTLS), also known as Two-Way TLS, is an extension of the Transport Layer Security (TLS) protocol. You can read about TLS in my article Protectors of the Online World: How TLS Keeps Us Safe. The concept of mutual authentication in TLS has been part of the TLS specification since its early versions.

TLS itself was introduced as a successor to the Secure Sockets Layer (SSL) protocol. SSL, the predecessor to TLS, was created by Netscape Communications in the mid-1990s. TLS 1.0, the first version of TLS, was defined in 1999 in RFC 2246.

Mutual authentication, which is a fundamental part of mTLS, involves both the client and the server presenting certificates to each other to establish trust and verify their identities. This concept of mutual authentication was present in TLS from the beginning.

While mTLS as a term and concept has become more commonly used in recent years, the core idea of mutual authentication has been an integral part of TLS since its inception. Organizations and applications have increasingly adopted mTLS for enhanced security in various use cases, but the underlying principles have been part of TLS from the early days of its development.

The usage of Mutual Transport Layer Security (mTLS) has seen a significant increase in recent years, particularly in the 2010s and beyond. The widespread adoption of mTLS has been driven by the growing awareness of cybersecurity threats, regulatory requirements, and the need for robust authentication and encryption in modern applications. Many organizations have implemented mTLS to enhance the security of their systems and protect sensitive data in transit.

Let’s understand how Mutual Transport Layer Security (mTLS) works with an example of a secured conversation between Seeta and Ram.

mTLS workflow.

1. Client Hello (Step 1):

Seeta initiates a secure conversation with Ram by sending a message. She says, “Hi, Ram! Let’s talk securely using mTLS. I support these encryption methods: AES and RSA. Here’s a random string: ABC123.”

2. Server Hello (Step 2):

Ram responds, “Hello, Seeta! It’s great to talk securely with you. Let’s use AES encryption. Here’s my random string: XYZ789. Also, here’s my certificate to prove it’s really me!”

3. Server Certificate Validation (Step 3 and 4):

Seeta checks Ram’s certificate to ensure it’s valid and signed by a trusted authority. This certificate includes Ram’s public key, which she will use for secure communication later.

4. Client Authentication and Validation (Steps 5 and 6):

Seeta also shares her certificate with Ram for authentication purposes. Ram verifies the validity of Seeta’s certificate, ensuring it is signed by a trusted authority. Seeta’s certificate includes her public key, which will be used for secure communication.

5. Generating the premaster secret (Step 7):

Now, both Seeta and Ram use their random strings (ABC123 and XYZ789) and a secret value called the premaster secret to generate a shared secret key that they will use for encrypted communication.

The premaster secret is generated by the client (Seeta) and sent to the server (Ram) securely. Seeta is responsible for creating the premaster secret as part of the initial steps of the mTLS handshake.

6. Finished Messages (Step 8):

Seeta and Ram use the premaster secret to generate the master secret key. Seeta then sends a “finished” message to Ram, saying, “I finished setting up our secret key! Let’s chat securely!”

Ram replies with his own “finished” message, confirming that he also completed the master secret key setup.

The master secret keys generated at the client and server during the mTLS handshake are not the same; they are unique to each party. However, they are often referred to as a “shared secret key” because both the client and server independently compute this key using their own inputs (including the premaster secret) and then use it for symmetric encryption and decryption of data during the mTLS session.

Now, Seeta and Ram can start exchanging messages using the shared secret key for encryption. Any data they send back and forth will be encrypted with this key, ensuring that only they can understand it. This makes their conversation secure and private, protecting it from eavesdropping.

In real-world scenarios, mTLS works similarly, but instead of individuals, its computers and servers establish secure connections over the internet. This ensures that our online communications and transactions remain safe and protected from potential threats and unauthorized access.

Must Read for Continuous Learning

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in System Weakness

System Weakness is a publication that specialises in publishing upcoming writers in cybersecurity and ethical hacking space. Our security experts write to make the cyber universe more secure, one vulnerability at a time.

No responses yet

Write a response