Always verify from client perspective, not just IIS Manager UI.
Lab: Configure SSL and HTTPS on IIS
Import cert, bind HTTPS, validate netsh binding, enforce redirect and HSTS.
🧒 Simple Explanation (ELI5)
Put a lock on your site door and make everyone use that lock.
🔧 Why Do We Need It?
- Protect credentials and tokens.
- Meet compliance requirements.
- Avoid browser trust warnings.
- Prevent downgrade attacks.
🌍 Real-world Analogy
Switching from postcard mail to sealed registered mail with identity verification.
⚙️ Technical Explanation
IIS HTTPS requires cert in LocalMachine\My with private key plus site binding and HTTP.sys sslcert mapping. Add HTTP→HTTPS redirect and HSTS header for strict transport.
📊 Visual Representation
⌨️ Commands / Syntax
$pass = ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force Import-PfxCertificate -FilePath C:\certs\site.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $pass appcmd set site /site.name:"myapp" /+bindings.[protocol='https',bindingInformation='*:443:myapp.local'] netsh http show sslcert # test curl -vk https://myapp.local
💼 Example (Real-world Use Case)
Renewal runbook updates 20 SNI bindings and validates each host with scripted curl checks.
🧪 Hands-on
- Create/import test cert.
- Add HTTPS binding for test host.
- Verify cert thumbprint in netsh output.
- Add HTTP redirect rule.
- Add HSTS and re-test.
🐛 Debugging Scenario
Failure: Browser still shows old cert.
- Check netsh sslcert thumbprint.
- Remove stale binding and re-add.
- Confirm SNI host is correct.
- Check intermediate cert chain.
- Retest with curl -v.
🎯 Interview Questions
Beginner
LocalMachine\My with private key.
Forces future HTTPS and blocks protocol downgrade.
TLS extension to host multiple certs on one IP:443.
Unique identifier for ssl binding mapping.
Server cert + intermediates + trusted root path.
Intermediate
Use win-acme scheduled renewals and post-check scripts.
Stale HTTP.sys sslcert binding still points to old thumbprint.
Use SSL Labs plus local schannel/curl checks.
Wildcard for many subdomains; SAN for explicit host list including root.
Condition redirect only when HTTPS is off.
Scenario-based
Check hostname mismatch or missing intermediate cert.
Review SNI bindings and hostname-specific sslcert mappings.
Use temporary isolated compatibility endpoint and upgrade plan.
Script curl/Invoke-WebRequest per hostname and parse cert dates.
Ensure all subdomains support HTTPS before includeSubDomains/preload.
🌐 Real-world Usage
This is a recurring monthly/quarterly operational activity in every IIS estate.
📝 Summary
Correct HTTPS on IIS means cert import, binding correctness, validation, and strict transport enforcement.