After many years of being served over HTTPS, I finally remembered to enable HTTP Strict Transport Security. There was never any reason not to – all traffic to any website or app at goes through my reverse proxy, and it’s served with a wildcard * certficiate. If it doesn’t go through my reverse proxy, that’s a bug, and should be fixed.

Several days after making this change, I closed my GMail tab, and typed to get it back. Chrome responded with “Connection closed”. Google must be down! But that seems pretty unlikely, so I tried it in curl:

$ curl -v
*   Trying 2607:f8b0:4006:808::2013:443...
* Connected to (2607:f8b0:4006:808::2013) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to

OK, so that doesn’t work. What about

$ curl -v
*   Trying 2607:f8b0:4006:808::2013:80...
* Connected to (2607:f8b0:4006:808::2013) port 80 (#0)
> GET / HTTP/1.1
> Host:
> User-Agent: curl/7.65.3
> Accept: */*
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Location:
< Date: Sun, 05 Jul 2020 15:58:13 GMT
< Content-Type: text/html; charset=UTF-8
< Server: ghs
< Content-Length: 231
< X-XSS-Protection: 0
< X-Frame-Options: SAMEORIGIN
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<H1>301 Moved</H1>
The document has moved
<A HREF="">here</A>.
* Connection #0 to host left intact

That works, so Google must not be down. Why doesn’t it work with HTTPS, though?

The answer is: it was never HTTPS. I have DNS set up so that is a CNAME for, so my server isn’t handling the request. To be HTTPS, Google would have to issue a certificate for me. If they didn’t, the browser would complain about a hostname mismatch ( isn’t But I know they’re not doing that, because I have a CAA DNS record that says only Let’s Encrypt can issue certificates for, and I review the CT logs from time to time to see who is issuing certificates for me. Nobody is issuing certificates, so of course visiting in the browser and having it work has to mean that it’s non-TLS. The thought did not occur to me when I was enabling HSTS, but it’s obvious in retrospect.

I am actually super glad that I caught this, because there’s a 99.999% chance that if I typed “” into a web browser and it asked me for my Google password, I would have typed it. It would have been super-easy to phish me. (Hopefully my 2FA key would have noticed that I wasn’t at Google, but I could probably have been convinced to type a OTP. 2FA is only as strong as its weakest link, and while tokens are phishing-resistant, the backup systems for a lost token aren’t.)

I adjusted to hit my own reverse proxy, which can be configured to issue the redirect itself:

- name:
  domains: [""]
      - match: { prefix: "/" }
            - header:
                  key: location
                  value: ""
              append: false
            - header:
                  key: content-type
                  value: "text/html; charset=UTF-8"
              append: false
            status: 301
                inline_string: |
                    <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
                    <TITLE>301 Moved</TITLE></HEAD><BODY>
                    <H1>301 Moved</H1>
                    The document has moved
                    <A HREF="">here</A>.

You could get away with just issuing the redirect with an empty body, but since we have the opportunity to exactly duplicate the functionality that Google provides over HTTP, we do so. Maybe it will come in handy someday.

Now it works again, and HTTP Strict Transport Security saved me from being phished by a shady network in the future.

(I wrote this post because there is a 100% chance that this will happen to you too. Of course, you probably enabled HSTS decades ago because you are responsible, so this information comes too late. Oh well!)