Script Valley
HTTP & The Web: How It Actually Works
HTTPS and TLS Security/Assessment

Practice & Assessment

Test your understanding of HTTPS and TLS Security

Multiple Choice Questions

6
1

A server's TLS certificate expired two days ago but the development team says 'it worked fine yesterday'. What most likely caused the sudden failure?

2

A developer uses certbot --nginx to set up HTTPS but forgets to open port 80 in the firewall. Which ACME challenge type will fail?

3

What is forward secrecy and why does TLS 1.3 mandate it?

4

A site has HSTS with max-age=31536000 but you need to temporarily serve HTTP for a maintenance redirect. What problem will you face?

5

Your browser shows ERR_CERT_AUTHORITY_INVALID for an internal tool using a self-signed certificate. What is the correct long-term fix?

6

An HTTPS page loads an image from an HTTP URL. What will modern browsers do?

Coding Challenges

1
1

Certificate Inspector

Write a Node.js or Python script that accepts a hostname as a CLI argument, connects to port 443, and prints: (1) the certificate's subject Common Name and all SAN domains; (2) the issuer organization; (3) the validity period (notBefore and notAfter); (4) whether the certificate is currently valid, expired, or not yet valid; (5) the number of days until expiry (or since expiry). Use only the built-in tls module (Node) or ssl module (Python). No external libraries. Estimated time: 25–30 minutes.

Medium

Mini Project

1

HTTPS Health Checker

Build a CLI tool that accepts a list of domains (from a file or CLI arguments) and produces a TLS health report for each. For each domain the tool must check and report: (1) whether HTTPS is reachable on port 443; (2) certificate validity status and days until expiry; (3) whether the domain in the certificate matches the requested domain; (4) the TLS version negotiated; (5) whether HSTS is present and its max-age value; (6) whether HTTP (port 80) redirects to HTTPS. Output a tabular summary and exit with code 1 if any domain has a certificate expiring in fewer than 14 days or is already expired. Use only standard library TLS/SSL modules.

Hard