What this is about
The small padlock next to a web address means one thing. Your browser and the site have agreed on a secret, so nobody in between can read or change what you send. It does not mean the site is trustworthy. A site made to trick you can have a padlock too. This article explains what HTTPS really promises, how a site gets its certificate, and how ours get renewed without anyone remembering to do it.
Why it matters
People are told "look for the padlock". That advice is half right. The lack of a padlock is a real warning, because your data travels in the open. The presence of one is only a floor. If you learn what the lock covers, you will stop trusting it for the wrong things, and you will know what to demand from a site you run.
How it works
Two promises
HTTPS is the normal web with a private layer on top. The layer is called TLS. It makes two promises.
- Privacy. The bytes on the wire are scrambled. Someone on the same Wi-Fi sees that you talked to a site, but not what you said.
- Identity. The site proves that it owns the name you typed. It does this with a certificate.
Both promises are about the name in the address bar. They say nothing about what the site does with your data once it has it.
What a certificate is
A certificate is a small file. It says "this public key belongs to this name". It is signed by a company that browsers already trust, called a certificate authority. The browser checks the signature and the name. If the name does not match or the file has expired, you get a warning page.
Certificates expire on purpose. A short life limits the harm if a key leaks. The price of that choice is that someone has to renew them.
Renewal without remembering
Years ago, renewal was a yearly chore, and an expired certificate was a common cause of outages. Today a free authority called Let's Encrypt can renew by program. Our web server, Caddy, does this itself. The comment at the top of the Caddyfile in our base template says it plainly: if the domain setting is a real domain, Caddy asks Let's Encrypt for a certificate on its own. If the setting is localhost, it uses a private authority of its own for local tests.
That is why nobody on our side owns a "renew the certificate" reminder for those sites. The server handles it, and our checks fetch the pages from outside to make sure it still works.
Not every site terminates TLS the same way
On aiazic.com the public line ends at Cloudflare. Our own web server there listens on a plain port inside the machine, and its settings turn off automatic certificates. The tunnel carries the traffic from Cloudflare to our door. That is a deliberate choice for that site. It also shows an important point: "where the lock ends" is a design decision. If you use a service in front of your site, ask where the private line stops and what travels unprotected after that point.
Headers that tell the browser to stay strict
A site can ask browsers to be strict. The header called HSTS says "only talk to me over HTTPS, and remember that for this long". In our base template the time is 31,536,000 seconds, which is one year. On aiazic.com it is 63,072,000 seconds, two years, and it covers subdomains. We also send a header that stops browsers from guessing file types and another that limits what an address leaks when you click a link.
Those headers do not change how the page looks. They narrow what can go wrong if something odd happens on the way.
What the padlock does not tell you
- That the site is honest. A lookalike address can have a valid certificate for its own name.
- That the site is well built. A lock does not protect against a bug in the app.
- That your data is safe afterwards. Passwords and keys can still leak from a database.
- That the page is the one you meant. If you mistype a name, you get a private line to the wrong place.
Read the address, not just the icon.
We wrote a TLS library
Because TLS sits under almost everything, we wrote our own implementation in Mojo, called mojo-tls. Its description says it does TLS 1.3 and 1.2, as client and server, with X.509 certificates, in pure Mojo, with no OpenSSL and no C library. It is a learning and engineering project, and we would not tell you to swap it into a bank. It is useful for seeing how the pieces fit, because the whole stack is in one language and open to read.
Words you may not know
- HTTPS: the web with a private layer. The S stands for secure.
- TLS: the private layer itself.
- Certificate: a signed file that ties a public key to a name.
- Certificate authority: a company that browsers trust to sign certificates.
- Let's Encrypt: a free certificate authority that renews by program.
- HSTS: a header that tells browsers to use only HTTPS for a site.
- Public key: a number a site shares so others can send it secrets.
Try it
- Click the padlock on any page of amarbaro.com and open the certificate details. Read who issued it and the dates.
- Run
curl -I https://aiazic.comand look for thestrict-transport-securityline. - Read the TLS library we wrote: github.com/amarbaro/mojo-tls.
- If you run a site, add a calendar entry to test it from outside once a week, even if renewal is automatic.
Read next
- A Reboot Is Not a Health Check: fetching real pages from outside, which also catches an expired certificate.

Comentarii
Niciun comentariu încă.
Conectare pentru a comenta.