Ribbon Icon Celebrating 27 Years – Announcing the new GeoTrust Horizon® platform. Learn More
Home Icon > Resources > Expert Guides > Beginner’s Guide to SSL/TLS > How Does SSL/TLS Work? TLS Explained

How Does SSL/TLS Work? TLS Explained

When you connect to a website, the information exchanged between your device and the web server hosting the site is unprotected by default. It’s like sending postcards that anyone can read, steal, and modify. That’s where TLS steps in.

Transport layer security (TLS) is the modern internet security protocol that enables users and devices to transfer data securely across open networks.

But how does TLS work? Here’s TLS explained in plain English.

Automate Your SSL Certificate in 5 Minutes

Keep your website secure and online… no manual certificate renewals needed!

How Does TLS Work?

If they connect as-is, then any sensitive data your customer shares is vulnerable to interception, theft, or modifications by a hidden attacker. This is because the internet is an open network, which is insecure and transmits plaintext data.

To avoid this insecurity, their client and your web server engage in a TLS handshake to establish a secure connection channel. During this process, the TLS standard protocol works behind the scenes by enabling:

  • Secure authentication. The TLS process ensures that your customers are communicating with your legitimate business — no impostors allowed.
  • In-transit data encryption. SSL/TLS scrambles the transmitted information into gibberish that only the authorized parties with the right key (i.e., the client and your web server) can decrypt. It does this by
    • using asymmetric cryptography (meaning it uses separate keys to encrypt and decrypt data) to securely share session key data, and
    • switching to the less taxing symmetric cryptography (which uses one key to encrypt and decrypt data).
A basic illustration that showcases how public key encryption works, using a server's public-private key pair to securely transmit data across the insecure network known as the internet
Image caption: This graphic illustrates how a client and web server communicate securely across an insecure public network (i.e., the Internet) to exchange sensitive data. In this case, the server is the recipient, so its public key is used by a connecting client to secure the data in transit and the server uses it on the receiving end to decrypt it.
  • Data integrity protection. SSL/TLS uses cryptographic hashing to prevent the unauthorized modification of the data traveling back and forth, keeping it safe and sound against threat actors who wish to manipulate the data.

In a matter of seconds, TLS safeguards your website users and data from prying eyes. Your users’ browsers will display a padlock icon or a message proclaiming “this site is secure,” and your website’s URL will begin with the hypertext transfer protocol secure (HTTPS) prefix. This is the TLS protocol explained in a nutshell, which is made possible by uploading an SSL/TLS certificate to your website’s domain.

TLS explained graphic: A screenshot of a website's EV SSL/TLS certificate, which displays a wealth of information about the domain and the company that owns it
Image caption: A screenshot illustrating the concept of an SSL/TLS certificate that’s installed on a public-facing website.

The TLS Handshake Explained

The TLS handshake is a cryptographic process that works as a formal introduction between a computer and your web server. Think of it like when you introduce yourself to a new person and shake hands, but with a few added security measures thrown in for good measure.

Here’s how it plays out in TLS 1.2:

  1. Client Hello. When a customer visits your website, the client transmits a message to your web server. The message includes the supported encryption algorithms (i.e., cipher suites) and a randomly generated number (i.e., the client random).
  2. Server Hello. Your web server returns a “Server Hello” message of its own. This communication includes the server’s chosen encryption method, its SSL/TLS certificate and public key, and another random number (i.e., server random). The certificate acts like an ID card, validating the server’s legitimacy. It includes your server’s public key and is signed by a trusted certificate authority (CA).
  3. Server’s identity verification and pre-master secret generation. The client double-checks the server’s certificate against a list of trusted CAs. If the certificate is valid, the client generates creates something called a “pre-master secret.” It then encrypts the secret using the server’s public key and sends it over to the server.
  4. Session keys generation. Using its corresponding private key, the server decrypts the shared pre-master secret. Then, both the client and the server create a shared session key using the pre-master secret, the client random, and the server random. This session key is what both parties will use to encrypt and decrypt the data exchanged going forward.  
  5. Change cypher spec and finish message (client). The client informs the server that it’s about to switch to symmetric encryption and adds a “Client Finished” note.
  6. Change cypher spec and finish message (server). Your web server switches to symmetric encryption, too, and concludes the handshake with a “Server finished” message.
An illustration that demonstrates the roundtrips involved in the TLS 1.2 handshake
Image caption: A basic illustration that shows how TLS 1.2 works in a nutshell.

Boom. From now onward, all data exchanged between your customer’s client and your web server is encrypted. Every bit of information transmitted is secure and can’t be read or modified by anyone unless they have the shared session key.

Now, if all of that sounds intricate, remember that it all happens in mere milliseconds. Nevertheless, the faster a website loads and the more secure it is, the happier your customers become. So, that’s what the newest TLS protocol version, 1.3, is all about.

TLS 1.3: A Handshake with a Twist

At first, there was SSL 2.0. That’s what set the standard for secure online communication and established the first “handshake.” Then SSL 3.0. Over three decades, multiple secure protocol versions have come and gone, with more robust TLS protocol versions introduced, eventually taking their place.

While the term SSL still persists in users’ minds, TLS 1.3 is the latest version of the TLS protocol, taking security to a completely different level. TLS 1.3 offers a faster and more secure handshake than the earlier TLS and SSL protocol versions, including TLS 1.2, thereby enhancing users’ experience and reducing the risks of potential vulnerabilities:

  1. Client Hello. Just like with TLS 1.2, the client sends the list of supported algorithms and the client random. However, in this step, the client also guesses which key agreement protocol the server is likely to prefer and sends its key share for that particular protocol.
  2. Server Hello and server finished message. The web server replies with the chosen key agreement protocol. The same message also comprises your server’s key share, its SSL/TLS certificate, and the “Server finished” message.
  3. Client finished message. In this last step, the client authenticates the server, creates the necessary keys, and sends the “Client finished” message.

Now, the symmetrically encrypted session kicks in, allowing for swift and secure communication. That was fast, right? Everything was sorted in half of the steps, saving an entire round-trip.

An illustration that demonstrates the roundtrips involved in the TLS 1.3 handshake
Image caption: An illustration demonstrating how the TLS 1.3 handshake works and the reduced number of roundtrips required.

One of the biggest differences between TLS 1.2 and 1.3 is that the latter enables perfect forward secrecy. PFS ensures that your past transmitted data can’t be compromised if a key gets compromised down the road. (This is a big concern relating to harvest now, decrypt later [HNDL] attacks, wherein someone intercepts and stores encrypted data to decrypt it later using a compromised stored key.)

PFS means that a unique, ephemeral (temporary) key is used for every session and that the key isn’t stored.

Final Words About How SSL/TLS Works (TLS Explained)

In essence, TLS (i.e., transport layer security) pairs the validated identity information from SSL/TLS certificates with supported cryptographic security mechanisms to protect data as it transmits over the internet.

Through the handshake, TLS facilitates encrypted connections between a client and a web server. The process also gives users peace of mind, offering reassurance that they’re engaging with a legitimate organization and not with an impostor.

So, now that you know how TLS works, secure your website. Get an SSL/TLS certificate, install it on your web server, and let TLS work its magic. It’ll transform your online presence into a secure and trustworthy experience for all your visitors.

Automate Your SSL Certificate in 5 Minutes

Keep your website secure and online… no manual certificate renewals needed!