Secure Socket Layer (SSL) and Transport Layer Security (TLS)
What Are SSL and TLS?
SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) are cryptographic protocols that encrypt data exchanged between a client, such as a web browser, and a server, ensuring privacy and data integrity during transmission.
How TLS Works
TLS uses a process called a handshake, during which the client and server agree on encryption methods, exchange keys using asymmetric cryptography, and then switch to faster symmetric encryption for the remainder of the session.
SSL vs TLS
TLS is the modern, more secure successor to SSL. SSL is now considered outdated and vulnerable, and virtually all secure websites today use TLS, even though the term "SSL" is still commonly used informally.
Why HTTPS Matters
Websites using HTTPS have TLS encryption enabled, protecting sensitive information like login credentials and payment details from being intercepted, and helping users verify they are communicating with the legitimate website.
The TLS 1.3 Handshake, One Message at a Time
- Client Hello: the browser lists the TLS versions and cipher suites it supports and sends its key-share values for the key exchange.
- Server Hello: the server picks the version and cipher, sends its own key share, and both sides can now compute the same session keys.
- Certificate and proof: the server sends its certificate chain and signs the handshake with its private key, proving it owns the certificate.
- Finished: both sides confirm the handshake was not altered, and encrypted application data starts flowing.
TLS 1.3 needs fewer round trips than older versions and removes weak options entirely, which is why it is both faster and safer. The browser also checks that the certificate was issued by a trusted certificate authority, has not expired, and matches the domain name in the address bar.
Protocol Versions and What to Allow
| Version | Status | Recommendation |
|---|---|---|
| SSL 2.0 and 3.0 | Deprecated, known serious weaknesses | Disable completely |
| TLS 1.0 and 1.1 | Formally deprecated | Disable |
| TLS 1.2 | Still widely used and secure with modern ciphers | Allow |
| TLS 1.3 | Current version | Allow and prefer |
Checking and Configuring a Server Safely
You can inspect your own site's certificate and negotiated protocol from a terminal. This is a read-only check that shows the certificate chain, expiry date and version in use:
openssl s_client -connect example.com:443 -servername example.com </dev/null \
| openssl x509 -noout -subject -issuer -dates
For an nginx server, a sound baseline is to accept only TLS 1.2 and 1.3 and redirect all plain HTTP traffic:
server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
}
Free certificate authorities such as Let's Encrypt, together with a client like Certbot, can issue and renew certificates automatically. Online scanners from reputable security vendors can also grade your configuration and point out weak settings.
Frequent Misconfigurations and How to Prevent Them
- Expired certificates: automate renewal and set a monitoring alert well before the expiry date.
- Missing intermediate certificates: serve the full chain file, or some clients will reject the connection.
- Mixed content: an HTTPS page that loads scripts or images over HTTP weakens protection; update every resource URL.
- Turning off certificate validation in code: fix the trust store instead, because skipping checks allows impersonation.
- Exposed private keys: keep key files readable only by the server process and never commit them to version control.
Ready to master Cybersecurity Training Course?
Join Uncodemy's hands-on training and build real-world cybersecurity skills with expert mentors.