2024-12-19
Short lived TLS certificates and graceful rollover in web servers
One of the bits of recent TLS news is that Let's Encrypt is going to start offering 6-day TLS certificates. One of the things that strikes me about this is that various software, web servers included, may finally be motivated to handle changed TLS certificates in a better way than is common today, because TLS certificates will be changing much more frequently.
A lot of programs that use TLS certificates, web servers included, have historically (and currently) not actually 'handled' changing TLS certificates as such. Instead they loaded TLS certificates on startup and then to change the TLS certificates, you either restarted them entirely or notified them to 'reload' everything. A general restart or reload often has side effects; ongoing connections (for things like WebSockets) might get closed, requests might be abruptly ended, and during a restart some requests would get 'connection refused' results. Beyond this, even a reload is traditionally a global thing, where more or less your entire configuration is updated, not just TLS certificates. If an error or a significant change has snuck into the web server configuration but been latent without a restart or a reload, your TLS certificate rollover is about to activate it.
(This also applies to changes you're in the middle of doing. At the moment, TLS certificate renewal is so infrequent that most people can basically ignore the possibility that it will be triggered while you're doing some other work on your web server configuration. In an environment where TLS certificates roll over every few days and your TLS certificate renewal automation may well run every few hours, this is perhaps not so unlikely any more.)
My impression is that web servers have generally handled TLS certificates this way because it was the easiest option. They didn't have automatic hot reloading of TLS certificates any more than they had automatic hot reloading of anything else, nor did they have fine grained manual reloading of specific elements of the configuration. The operation people wanted almost all of the time was either 'restart the server' or at least 'reload all of the configuration', and it happened infrequently enough that you mostly didn't worry about the side effects of this.
(If you were running a web server environment that was big enough to care you built or at least ran special software to gracefully put redundant web servers in and out of service. Such software might support on the fly switching of TLS certificates without interruptions.)
In my view, automatic hot reloading of TLS certificate isn't ideal; since TLS certificates for web servers typically involve multiple files, there are some tricky issues involved. Instead, what I hope web servers add is specific on-command reloading of some or all TLS certificates, in the same way that many DNS servers can be told to reload a specific DNS zones. This would allow TLS certificate rollovers to have only narrow, tightly scoped changes on web servers and hopefully to do this with little or no interruptions to their activities.