How would you test and verify that an ASP.NET Core application's HTTPS configuration (certificate validity, protocol versions, HSTS header) is correctly configured before or after a production deployment?
Short answer
Tools like openssl s_client (command-line inspection of the certificate chain and negotiated protocol), online scanners like SSL Labs' SSL Test (comprehensive automated grading of TLS configuration, protocol support, and known vulnerabilities), or curl -I to inspect response…
Advertisement
AModel answer
Tools like openssl s_client (command-line inspection of the certificate chain and negotiated protocol), online scanners like SSL Labs' SSL Test (comprehensive automated grading of TLS configuration, protocol support, and known vulnerabilities), or curl -I to inspect response headers (confirming Strict-Transport-Security is present) all provide independent verification that the deployed HTTPS configuration matches what was intended, catching misconfigurations before they become a production incident or failed security audit.
# Inspect the certificate and negotiated protocol directly
openssl s_client -connect api.example.com:443 -tls1_2
# Verify the HSTS header is present
curl -I https://api.example.com | grep -i strict-transport-security
# Or use an online tool: https://www.ssllabs.com/ssltest/Real-world example
Before marking a production HTTPS deployment complete, a team runs their domain through SSL Labs' SSL Test, catching that TLS 1.0 was still unexpectedly enabled at the load balancer layer (despite being explicitly disabled in the application's own Kestrel configuration), tracing the actual misconfiguration to infrastructure outside the application itself.
Likely follow-ups
- How would you incorporate this kind of TLS configuration verification into an automated CI/CD deployment pipeline?
- What specific grade/criteria should a production API's SSL Labs score meet before going live?
Related topics