Go REST

HTTP vs HTTPS

TLS in 800 words: what HTTPS adds, what it does not protect, why mixed-content errors exist, and why public APIs should be HTTPS-only.

HTTPS is HTTP wrapped in TLS. The protocol semantics (methods, status codes, headers, bodies) are identical. The difference is the channel: HTTPS connections are encrypted, authenticated, and tamper-evident; HTTP connections are not. This matters more than people new to web development usually realise.

The three properties TLS adds

What TLS does NOT protect

Why "mixed content" errors exist

When an HTTPS page tries to load an HTTP resource (an image, a stylesheet, an XHR request), the browser blocks or warns. The reason: the HTTPS page promises confidentiality and integrity for everything on it. An HTTP load breaks that promise. Someone could MITM the image to inject a tracking pixel, or rewrite the script to steal cookies.

The fix is always the same: serve everything over HTTPS. There is no good reason in 2025 to serve any production resource over plain HTTP.

Certificates 101

A TLS certificate is a signed statement: "the public keyXXX belongs to the hostnameexample.com, issued by Trusted CA, valid until 2025-12-31". The browser ships with a list of trusted CAs (Mozilla's CA bundle on Linux, the OS keychain on Mac/Windows). When the server presents a cert, the browser walks the signature chain back to a trusted root.

Three modern shifts:

TLS versions

Servers usually accept both 1.2 and 1.3 clients. The protocol negotiates down to whatever both sides understand.

SSL vs TLS

SSL is the old name. TLS is the current name. SSL 3.0 was renamed TLS 1.0 in 1999. People still say "SSL certificate" out of habit, but every cert in production is a TLS cert. The terms are interchangeable in casual speech; in technical writing, use TLS.

Why public APIs must be HTTPS-only

Three concrete reasons:

The Go REST API is HTTPS-only at gorest.co.in. There is no plain-HTTP fallback because there should not be one.

The smallest useful TLS knowledge

If you remember one thing about HTTPS: it makes the connection private and verified. It does not make the server safe, the data correct, or the application secure. Treat HTTPS as table stakes, not a security strategy.

Continue reading

More primers

All primers Glossary Integration guides