Introduction
Imagine sending a secret letter through the mail, but anyone could open it and read it. The SSL/TLS protocol solves this problem by protecting information sent over the internet so only the intended person can see it.
Imagine you want to send a locked box with a secret message inside to a friend. You both agree on a special lock and key beforehand. When your friend receives the box, they use the key to open it and read the message safely.
┌───────────────┐ Handshake ┌───────────────┐
│ Client │──────────────────────▶│ Server │
│ (Your device) │ │ (Website) │
└───────────────┘ └───────────────┘
│ │
│ Secure Encrypted Data │
│◀──────────────────────────────────────▶│
│ │https:// to show SSL/TLS encryption.http:// is not secure, ftp:// is for file transfer, file:// is local files.1. Client sends 'ClientHello'
2. Server responds with 'ServerHello' and certificate
3. Client verifies certificate
4. Client sends encrypted 'PreMasterSecret'
5. Server decrypts 'PreMasterSecret'
if url.startswith('http://'):
print('Secure connection')
else:
print('Not secure')https://, not http://.http:// as secure, so it should check for https:// instead.Pass the test and this pattern moves unknown