Does SurrealDB support hot-reloading of TLS certificates without server restarts?
0 reputation · 30 May 2020, 08:56 UTC
0 reputation · 30 May 2020, 08:56 UTC
SurrealDB utilizes rustls for managing TLS connections and certificate validation. In production environments, maintaining high availability during certificate rotation is critical to avoid downtime.
Current documentation for SurrealDB (v1.x/v2.x) specifies the configuration of TLS certificates via the server startup flags, but it is unclear if the server monitors the filesystem for changes to these certificate files or if it loads them only once into memory during the initial boot sequence.
If the server does not automatically reload updated certificates, rotation requires a full process restart, which may impact cluster stability or client connectivity.
SurrealDB does not support hot‑reloading of TLS certificates without a server restart.
--tls-cert and --tls-key flags.rustls TLS stack used by SurrealDB does not provide a file‑watcher or automatic reload mechanism, and SurrealDB does not expose any runtime API to recreate the TLS acceptor.Because the TLS configuration is loaded into memory during initialization and there is no background thread monitoring the certificate files for changes, any update to the cert/key files will not be seen by existing connections. The server must be stopped and started again to load the new material.
--tls-cert and --tls-key (or update the existing files in‑place).If you terminate TLS at a front‑end proxy or load balancer (e.g., NGINX, Envoy, HAProxy) instead of directly in SurrealDB, hot‑reload can be handled there, eliminating the need to restart SurrealDB. Are you using SurrealDB as the TLS termination point, or do you have a reverse proxy in front of it?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.