SSL, TLS, mTLS
Network communication-এর encryption ও authentication।
আপনি bKash app-এ password type করছেন। সেই password আপনার phone থেকে bKash server পর্যন্ত যাচ্ছে — মাঝে আছে wifi router, ISP, hops। কেউ যদি traffic intercept করে — password chori? Modern web-এ এই risk eliminate করেছে TLS। প্রতিটি HTTPS site-এর behind এই technology।
Problem: Plain HTTP-এর সমস্যা
- Eavesdropping: Network-এ কেউ data পড়তে পারে।
- Tampering: Data modify করতে পারে।
- Impersonation: Fake server pretend করতে পারে।
SSL ও TLS
SSL (Secure Sockets Layer)
Netscape (১৯৯৫) — পুরাতন protocol। SSL 2.0, 3.0 vulnerable; deprecated।
TLS (Transport Layer Security)
SSL-এর successor (১৯৯৯)। বর্তমানে standard।
- TLS 1.0, 1.1 — deprecated।
- TLS 1.2 — widely used।
- TLS 1.3 — modern, faster, more secure (২০১৮)।
⚠️ মনে রাখুন: "SSL certificate" কথাটি এখনও common — কিন্তু আসলে TLS use হচ্ছে। নাম legacy।
TLS-এর তিন goal
- Confidentiality: Data encrypted — eavesdrop impossible।
- Integrity: Data tamper detect।
- Authentication: Server identity verify (mTLS-এ client-ও)।
TLS Handshake (Simplified)
- ClientHello: Client sent supported TLS version, cipher suite, random number।
- ServerHello + Certificate: Server-এর choice + certificate (public key)।
- Verify certificate: Client-এর browser CA-এর সাথে check।
- Key exchange: Symmetric key পরস্পরের কাছে establish — Diffie-Hellman।
- Finished: Encrypted communication start।
Client → Server: Hello + ciphers
Server → Client: Hello + certificate
Client: verify cert with CA
[Key exchange]
Both: derive shared symmetric key
Now: all data encrypted with symmetric key
TLS 1.3 Improvement
- 1-RTT handshake (TLS 1.2 ছিল 2-RTT)।
- 0-RTT resumption — repeat connection আরো fast।
- Removed weak ciphers।
- Forward secrecy mandatory।
Certificate
Certificate = digital ID card যা server-এর identity প্রমাণ করে।
Components
- Subject: Domain name (example.com)।
- Public Key: Encryption-এর জন্য।
- Issuer: Certificate Authority (CA) signed।
- Validity: Start ও expiry date।
- Signature: CA-এর digital signature।
Certificate Authority (CA)
- Trusted entity — DigiCert, Let's Encrypt, GlobalSign।
- Domain ownership verify করে certificate issue করে।
- Browser-এ pre-installed root CA list।
Let's Encrypt
Free, automated CA (২০১৬+)। আজ web-এর majority HTTPS।
Symmetric vs Asymmetric
- Asymmetric (RSA, ECDSA): Public + private key। Slow। Handshake-এ key exchange।
- Symmetric (AES): এক shared key। Fast। Actual data encryption।
TLS uses both — handshake-এ asymmetric দিয়ে symmetric key establish, তারপর symmetric দিয়ে data।
Mutual TLS (mTLS)
Standard TLS-এ client server-কে verify করে। mTLS-এ both sides verify।
কেন দরকার?
- Microservice-এ service-to-service authentication।
- API security — Nazi banking।
- IoT device authentication।
- Zero-trust network।
How it works
- Server certificate দেয় (normal TLS)।
- Server client-এর কাছে certificate request করে।
- Client client certificate দেয়।
- Server verify করে — known/trusted client কিনা।
Use cases
- Service mesh (Istio mTLS by default)।
- Banking API integration।
- Internal microservices।
SSL vs TLS vs mTLS
SSL
- Old (1995)
- Deprecated
- Vulnerable
- Don't use
TLS
- Modern
- Server auth only
- HTTPS standard
- Public web
mTLS
- TLS + client auth
- Both verify
- Microservice, API
- Zero-trust
বাস্তব উদাহরণ
- HTTPS websites: All modern web — TLS।
- Email (SMTP/IMAP STARTTLS): TLS।
- VPN: TLS-based।
- Service mesh (Istio): mTLS automatic।
- Banking integration: mTLS standard।
- Kubernetes etcd: mTLS internally।
Performance Considerations
- Handshake CPU-intensive — connection reuse important।
- TLS 1.3 1-RTT (TLS 1.2 2-RTT)।
- Session resumption — repeat connection fast।
- HTTP/2 + TLS standard।
- SSL termination — reverse proxy-তে decrypt।
Common Pitfalls
- Expired certificate — site down (Microsoft Teams 2020 incident)।
- Self-signed cert in production — browser warning।
- Weak cipher suite।
- Mixed content (HTTPS page-এ HTTP asset)।
- HSTS missing — downgrade attack।
সাধারণ ভুল ধারণা
- "SSL = TLS": No — TLS is replacement; SSL deprecated।
- "HTTPS = secure": Encryption only; app-এর XSS, SQL injection আলাদা।
- "Cert renewal manual": Let's Encrypt-এ automated।
- "mTLS overkill": Modern microservice-এ default trend।
Best Practices
- HTTPS everywhere — HSTS enable।
- TLS 1.2 minimum, prefer 1.3।
- Strong cipher suite — weak ones disable।
- Certificate auto-renew (Let's Encrypt)।
- Certificate transparency monitoring।
- Internal service: mTLS।
- SSL Labs test (A grade aim)।
📌 চ্যাপ্টার সারমর্ম
- SSL deprecated; TLS modern standard।
- TLS = encryption + server auth + integrity।
- mTLS = both sides authenticated।
- Certificate from CA — Let's Encrypt free + automated।
- TLS 1.3 fastest + most secure।