सभी SSL articles SSL और Certificates

Certificate Chain of Trust की explanation

जब आपका browser किसी HTTPS site से connect होता है, तो वह certificate को blindly trust नहीं करता। वह एक chain of trust verify करता है — certificates की एक linked chain जो आपकी site के certificate से लेकर एक pre-trusted root Certificate Authority (CA) तक जाती है।

तीन levels

┌─────────────────────────────────┐
│         ROOT CA                 │  Browser/OS में पहले से installed
│   (ISRG Root X1 for LE)        │  Self-signed, long validity (20+ years)
└───────────────┬─────────────────┘
                │ signs

┌─────────────────────────────────┐
│      INTERMEDIATE CA            │  Root द्वारा signed
│   (Let's Encrypt R3/R10)       │  Medium validity (5-10 years)
└───────────────┬─────────────────┘
                │ signs

┌─────────────────────────────────┐
│     YOUR CERTIFICATE            │  Intermediate द्वारा signed
│   (example.com)                 │  Short validity (LE के लिए 90 days)
└─────────────────────────────────┘

Root CA — Browsers और operating systems द्वारा trusted। Device के certificate store में stored। Self-signed (root के लिए कोई signer नहीं — यह खुद trust anchor है)। Root keys को hardware security modules में offline रखा जाता है।

Intermediate CA — Root द्वारा signed। Actually end-entity certificates issue करता है। अगर किसी intermediate को compromise किया जाए, तो सिर्फ उसे revoke करना होता है — root safe रहता है।

End-entity certificate — आपका certificate। Intermediate द्वारा signed। यह वह है जो आपका server browser को भेजता है।

Verification कैसे काम करता है

जब आपका browser एक certificate receive करता है:

  1. आपका certificate read करें — issuer का name extract करें
  2. Intermediate find करें — server की response या browser के cache से
  3. Intermediate signature verify करें — check करें कि यह trusted root द्वारा signed है
  4. आपके cert का signature verify करें — check करें कि यह intermediate द्वारा signed है
  5. Validity dates check करें — कोई भी certificate expired नहीं हुआ है
  6. Domain match check करें — certificate का SAN/CN URL से match करता है
  7. Revocation check करें — certificate revoked नहीं किया गया है (OCSP/CRL)

अगर कोई भी step fail होता है → browser एक security warning show करता है।

Intermediate क्यों important है

सबसे common SSL error missing intermediate certificate है। अगर आपका server intermediate के बिना सिर्फ आपका certificate भेजता है, तो browser trust chain नहीं बना सकता।

Nginx को fullchain.pem (आपका cert + intermediate combined) चाहिए:

ssl_certificate /etc/ssl/fullchain.pem;  # cert + intermediate

Apache अलग files use करता है:

SSLCertificateFile /etc/ssl/cert.pem          # your cert
SSLCertificateChainFile /etc/ssl/chain.pem    # intermediate

GetHTTPS fullchain.pem और अलग cert.pem + chain.pem दोनों files provide करता है, ताकि आपके पास किसी भी server के लिए सही format हो।

Let’s Encrypt की chain

Let’s Encrypt की current chain:

ISRG Root X1 (root, सभी trust stores में)
  └── Let's Encrypt R10 (intermediate, आपका cert sign करता है)
        └── yourdomain.com (आपका certificate)

Older devices के साथ compatibility के लिए IdenTrust के DST Root CA X3 के through एक cross-signed path भी है, लेकिन ज़्यादातर use cases के लिए अब इसकी ज़रूरत नहीं है।

FAQ

”certificate not trusted” errors कैसे fix करें?

लगभग हमेशा: आपका intermediate certificate missing है। fullchain.pem (Nginx) use करें या SSLCertificateChainFile chain.pem (Apache) add करें। इससे check करें:

openssl s_client -connect yourdomain.com:443 -servername yourdomain.com

“verify return:1” (good) vs “verify return:0” (chain problem) देखें।

क्या मैं browser में chain देख सकता हूँ?

हाँ। Padlock पर click करें → “Certificate” (या “Connection is secure” → “Certificate is valid”)। आप chain देखेंगे: आपका cert → intermediate → root।

अगर root CA compromise हो जाए तो क्या होगा?

Root को browser/OS updates के through trust stores से remove कर दिया जाता है। उस root के under issue किए गए सभी certificates untrusted हो जाते हैं। यह extremely rare है — root keys को physical access controls वाले offline hardware security modules में रखा जाता है।

Let’s Encrypt root से directly sign करने के बजाय intermediate certificate क्यों use करता है?

Security isolation। अगर intermediate key compromise हो, तो सिर्फ उसे revoke करना होता है — root safe रहता है। Root key offline रखी जाती है और सिर्फ intermediates sign करने के लिए use की जाती है। यह सभी major Certificate Authorities के लिए standard practice है।

क्या मुझे अपने server पर root certificate install करना होगा?

नहीं। Root certificate browsers और operating systems में पहले से installed होते हैं। आपके server को सिर्फ आपका certificate + intermediate भेजना होता है। Browser के पास पहले से root है और वह chain verify करने के लिए उसका use करता है।

Chain problems की debugging

Production में सबसे common SSL error incomplete certificate chain है। इसे systematically diagnose करने का तरीका यहाँ है:

Step 1: Check करें कि आपका server कौन सी chain भेजता है

echo | openssl s_client -connect yourdomain.com:443 -servername yourdomain.com 2>/dev/null

Output देखें:

Certificate chain
 0 s:CN = example.com
   i:C = US, O = Let's Encrypt, CN = R10
 1 s:C = US, O = Let's Encrypt, CN = R10
   i:C = US, O = Internet Security Research Group, CN = ISRG Root X1
---
Verify return code: 0 (ok)
  • Depth 0 = आपका certificate
  • Depth 1 = intermediate
  • “Verify return code: 0 (ok)” = chain complete है

अगर आप सिर्फ depth 0 देखते हैं (depth 1 नहीं), तो intermediate missing है।

Step 2: Chain fix करें

Nginx: fullchain.pem (cert + intermediate combined) use करें:

ssl_certificate /etc/ssl/fullchain.pem;  # NOT cert.pem

Apache: Intermediate को explicitly add करें:

SSLCertificateChainFile /etc/ssl/chain.pem

अगर आपने chain.pem खो दिया है: Let’s Encrypt का intermediate letsencrypt.org/certificates से download करें या GetHTTPS से अपना certificate re-issue करें।

Step 3: Fix verify करें

echo | openssl s_client -connect yourdomain.com:443 -servername yourdomain.com 2>/dev/null | grep "Verify return code"
# Must say: Verify return code: 0 (ok)

संबंधित लेख

SSL और Certificates 2026-05-07
SSL/TLS कैसे काम करता है: TLS Handshake explained
TLS handshake का visual walkthrough — आपका browser और server milliseconds में encrypted connection कैसे establish करते हैं। TLS 1.2, TLS 1.3, session resumption, और forward secrecy covered है।
SSL और Certificates 2026-05-07
SSL Certificate Types Explained: DV, OV, और EV
Domain Validation (DV), Organization Validation (OV), और Extended Validation (EV) SSL certificates compare करें। Validation, cost और actually आपको किस type की जरूरत है, इसमें differences जानें।
डिप्लॉयमेंट 2026-05-08
Nginx पर SSL Certificate कैसे Install करें
Nginx पर SSL certificate install करने की step-by-step guide। File upload, full server block config, TLS best practices, HTTP/2, HSTS, redirect setup, testing, और 6 common errors का troubleshooting included है।
अपने browser में मुफ़्त SSL certificate पाएँ
कोई installation नहीं, कोई account नहीं। आपकी private key कभी आपका device नहीं छोड़ती।
अपना certificate पाएँ