11/26/2024 | News release | Distributed by Public on 11/26/2024 06:07
Updated: November 26, 2024
Published: October 15, 2021
I'm always taken aback when I go to shake someone's hand and our hands don't connect as intended. This can also happen in the digital world - and it means that the SSL handshake failed.
Here's what I mean. When devices on a network - say, a browser and a web server - share encryption algorithms, keys, and other details about their connection before finally agreeing to exchange data, it's called an SSL handshake. During this handshake, the browser and server might ask to see each other's SSL certificates to verify them.
This handshake is essential for establishing a secure connection before transferring data, so it's important to understand what an SSL handshake is and what to do if it fails.
Before we dive into the SSL handshake process, remember that your website requires an SSL certificate to perform the process. If you need help deciding where to get one, I recommend you consider these 10 providers that offer free options.
Table of Contents
The SSL handshake is the process in which a client and server establish the encryption algorithms and secret keys they will use to communicate with each other securely, and exchange and validate each other's digital certificates.
Note: SSL and TLS are both cryptographic protocols that enable clients and servers operating over a network to communicate with each other securely. TLS has replaced SSL, but SSL is still a more commonly used term so we'll continue to use it in this post.
The exact steps in an SSL handshake vary depending on the version of SSL the client and server decide to use, but the general process is outlined below.
Host your website on a fully managed and optimized infrastructure that scales with your business.
For the remainder of the session, the server and client can now exchange messages that are encrypted with the same secret key, which was shared in step three. This is known as symmetric encryption. If you want to learn more about symmetric encryption, and how it differs from asymmetric encryption, I like this post.
The steps above will occur if the process goes smoothly. But what if it doesn't? Below I'll walk you through how to resolve an "SSL handshake failed" error message.
"SSL Handshake Failed" is an error message that occurs when the client or server wasn't able to establish a secure connection.
This might occur if:
The SSL Handshake Failed error message may appear differently, depending on the client application I'm using or server I'm trying to communicate with. For example, in GitHub, it will look something like this:
If I use Cloudflare, on the other hand, an SSL Handshake Failed will appear as a 525 error that looks something like this:
Now that I have explained some of the causes of the SSL Handshake Failed error, let me explain some solutions.
Let's start with the easiest fix. If the system time and date is incorrect on my computer or device, then it can cause the SSL Handshake Failed error. That's because time is essential when it comes to SSL certificates: they have finite lifespans and become invalid past their expiration date.
If you check your system time and date and it's correct, then move on to the next step.
Pro tip: If you travel often, you can set your computer to automatically update timezones.
It's possible that the browser I'm using is causing the SSL Handshake Failed error. It could be my settings, browser plugins, or another issue. To see if this is the problem, I always switch to another browser.
Let's say I was trying to connect to a website using Google Chrome, and it works just fine in Safari. In that case, I'll have to narrow down the problem. I usually go back and reset Google Chrome (or whatever browser I was using) to its default settings and disable all of my plugins.
Then, I re-configure my settings and enable my plugins one by one, testing my ability to connect to the website each time. By taking these steps, I should be able to isolate the specific setting or plugin that caused the SSL handshake error.
If you try another browser and you still see the SSL Handshake Failed error, then move on to the next step.
Pro tip: If you want to check if the browser is the issue before disabling your plugins, try opening the desired site using incognito mode first.
It's also possible that my firewall is causing the SSL handshake error by intercepting my request for inspection. To rule it out as the cause, I temporarily deactivate my firewall - but that can leave me vulnerable to an attack.
As an alternative, I can try adding the website to my allowlist. Here's the process I completed for Google Chrome:
If you try visiting that site again and you still see the SSL Handshake Failed error, then move on to the next step.
I may be getting the SSL Handshake Failed error because my device (the client) and server do not support the same SSL version, which is resulting in a protocol mismatch.
For example, let's say my browser only supports TLS 1.1 and my server only supports TLS 1.2 or 1.3 (the latest version). If these two try to establish a secure connection, then it will likely result in an SSL Handshake Failed error.
In that case, I'll need to update my browser. Most updated versions of major browsers like Google Chrome have TLS 1.2 automatically enabled. However, even if it is updated, I always check to make sure it's configured to support the latest TLS version as this is important.
Here's the easiest way I know how to check:
If you verify that your browser and server are using the same protocol, then move on to the next step.
Another reason I could be getting the SSL Handshake Failed error is that the client and server are using different Cipher Suites.
Just like a protocol mismatch, a client and server who do not have mutual support for the same CipherSuite will not be able to establish a secure connection.
I can compare which Cipher Suites my browser supports to the server of the website I'm trying to visit supports by once again visiting SSL Labs.
If you verify that your browser and server are using the same CipherSuite, then move on to the next step.
Any number of issues on an SSL certificate can prevent an SSL handshake from being completed. This may result in an SSL Handshake Failed error or another error message that ultimately means the handshake failed.
For example, you might see something like this:
If the SSL certificate has an incorrect hostname, for example, or it's past its expiration date, then the handshake will likely fail. So, it's important to ensure your SSL certificate is installed correctly and renewed when needed.
Pro tip: You can use an online tool like the above-mentioned SSL Server Test or SSL Shopper to test that your SSL configuration is installed, valid, and trusted in just a few minutes.
Troubleshooting my SSL handshake error taught me a valuable lesson: A step-by-step breakdown of the issue - and patience! - is essential for resolving the problem.
Since an SSL handshake is an essential step in keeping data transferred over the internet secure, it's important that users understand what the SSL Handshake Failed error means and how to fix it.
By following the steps above, I was able to resolve the issue and establish a secure connection between my device and the server I was trying to connect to.
Editor's note: This post was originally published in October 2021 and has been updated for comprehensiveness.
Host your website on a fully managed and optimized infrastructure that scales with your business.