Support Online
Skip to main content

What is SSL/TLS Authentication and How to Enable It?

This guide explains how SSL/TLS authentication works, why it's vital for secure connections, and how to enable it on different platforms.
You'll also learn how to test SSL authentication with the tools openssl, curl, Python, and Node.js.

🧠 What is SSL Authentication?

SSL (Secure Sockets Layer) or in its modern form TLS (Transport Layer Security) authentication; It guarantees the identity, integrity and reliability of the communication between the client and the server.

When a browser or API client sends an HTTPS request, it initiates a multi-step checking process to see if the server is truly who it claims to be.

🔍 Verification Process Steps

StepDescription
1. Certificate PresentationThe server sends the SSL certificate to the client.
2. CA ControlVerifies that the certificate has been signed by a recognized Certificate Authority (CA).
3. Domain MatchThe CN/SAN field in the certificate must match the domain being accessed.
4. Certificate Chain ControlLeaf → Intermediate → Root CA chain must be complete.
5. Duration and Cancellation ControlThe certificate must not have expired or been revoked by the CA.

🚫 If even one of these steps fails, the TLS handshake is interrupted and the browser issues warnings like ERR_CERT_COMMON_NAME_INVALID or SSL: CERTIFICATE_VERIFY_FAILED.


🔐 SSL Authentication vs SSL Encryption

FeatureSSL AuthenticationSSL Encryption
PurposeConfirming the server's identity and preventing fraudProtecting the confidentiality and integrity of data
When Will It HappenAt the beginning of the TLS handshakeAfter the connection is verified
Risk PreventedMan in the Middle (MITM) attackData theft and eavesdropping
ConclusionAuthentication providedData is transmitted securely

💡 The two work together. One cannot complete security without the other.


🔗 Certificate Chain (Chain of Trust)

SSL certificates create a chain in which trust is transferred from the root CA to the end user (Leaf Certificate).

LayerQuestExample
Root CAIt is the foundation of trust, pre-installed in the operating systemDigiCert Global Root G2
Search CASigns certificates, protects root CALet's Encrypt R3
Leaf (Server) CertificateIt is the certificate installed on your sitewww.example.com

⚠️ If your server does not send intermediate certificates you will get a “Missing Chain Error” (verify return:20).


🧰 Command Line SSL Authentication Tests

1️⃣ openssl s_client

openssl s_client -connect ornek.com:443 -servername ornek.com -showcerts

This command shows the certificate chain of the server. verify return:1 → success, verify return:20 → intermediate certificate missing.

2️⃣ curl --verbose


curl https://ornek.com -v

Shows TLS handshake details during the connection process. If successful, the encryption protocol appears; if unsuccessful, the reason is stated.

3️⃣ Online Testing Tools

VehicleDescription
SSL Labs (ssllabs.com)It grades your SSL configuration and lists weak protocols.
DigiCert SSL CheckerDetects intermediate certificate and installation errors.

💻 SSL Authentication in Application Code

🐍 Python (requests)


import requests
resp = requests.get('https://api.ornek.com', timeout=10)
print(resp.status_code)

requests does validation by default. If there is an invalid certificate, it gives an error.

🟢 Node.js (axios)


const axios = require('axios');
const agent = new (require('https').Agent)({ rejectUnauthorized: true });

axios.get('https://api.ornek.com', { httpsAgent: agent })
.then(res => console.log(`Durum: ${res.status}`))
.catch(err => console.error(`Hata: ${err.message}`));

By setting rejectUnauthorized: true, SSL authentication becomes mandatory.


🧪 Self-Signed Certificates

Self-signed certificates should only be used on test or internal networks.

StatusSafe Approach
Production EnvironmentNever use it, get a certificate from a trusted CA.
Test EnvironmentAdd the certificate to the system trust store.
ManagementCheck period and cancellation status regularly.

🧠 Best Practices for SSL Verification

ApplicationDescription
Use trusted CAGet a certificate from Let's Encrypt or commercial CAs.
Offer full chainAdd the fullchain.pem file to the Nginx/Apache configuration.
Automatic renewalAutomate renewal with certbot renew --quiet.
Use TLS 1.2+Turn off older SSL 3.0/TLS 1.0 versions.
Add security headersAdd HTTP headers such as HSTS, CSP.

🚫 Common Mistakes

ErrorEffectSolution
Disabling verificationMakes it vulnerable to MITM attacksNever use verify=False
Incorrect system timeCertificate appears invalidPerform NTP synchronization
Missing Interim CertificateCERTIFICATE_VERIFY_FAILED errorFull load chain
Domain name incompatibility“Domain does not match” errorFix CN/SAN values ​​
Skip Revocation checkRevoked certificates appear validEnable OCSP stapling

❓ Frequently Asked Questions (FAQ)

1. Why is SSL verification important?

It proves that the user is connecting to the correct server, preventing MITM attacks.

2. What is the difference between SSL authentication and encryption?

Authentication identity provides cryptographic confidentiality. Trust is not complete without one.

3. What causes SSL: CERTIFICATE_VERIFY_FAILED error?

The certificate may have expired, the chain is missing, or the domain name may be incorrect.

4. Is it safe to turn off validation in curl or Python?

No. It completely eliminates security. Fix the error instead.

5. What are the best testing tools?

openssl, curl -v, SSL Labs, DigiCert Checker.


##🏁 Conclusion SSL/TLS authentication not only encrypts data but also provides trust. Configuring your server's certificates correctly is important for both user security and SEO ranking.

🌩️ You can easily configure SSL verification on GenixNode and automatically renew your certificates.