WeCodeAcademy

HTTPS and Certificates

When you see the padlock and https://, your browser is using TLS (Transport Layer Security). TLS gives three things at once:

  • Encryption: eavesdroppers on the Wi-Fi or network cannot read the traffic.
  • Integrity: traffic cannot be altered unnoticed.
  • Authentication: a certificate, signed by a trusted certificate authority, proves the site really belongs to the domain.

In brief: the browser and server use public-key cryptography to agree a shared secret key, then switch to fast symmetric encryption for the conversation. HTTPS does not mean a site is trustworthy: criminals get certificates for fake domains too. It means the connection to that domain is private.

Examplepython
Open in editor »
Quick check

Does HTTPS prove a website is honest?

Your turn: write the code

Write is_secure(url) returning True only if the URL starts with https://. Print it for the two URLs, one per line.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.