大网数据广告活动
服务器运维问答

HAProxy - Dynamically updating SSL certs without a reload

· 52CE 我爱测

We currently use HAProxy to manage TLS termination for thousands of domains, all of which have Let's Encrypt certs getting rotated on a regular basis. The relevant config looks like this: frontend https-in bind *:443 ssl strict-s…

问题原文

原帖链接 · EyePulp · CC BY-SA 4.0

We currently use HAProxy to manage TLS termination for thousands of domains, all of which have Let's Encrypt certs getting rotated on a regular basis.

The relevant config looks like this:

frontend https-in

    bind *:443 ssl strict-sni no-sslv3 crt /usr/src/data/certs/

and /usr/src/data/certs/ is filled with a bunch of .pem files.

The SSL certs are changing all the time as they individually come up for renewal, or new domains get added/removed from our system. Right now we solve this by doing a bulk write of all the certs to /usr/src/data/certs/ and performing a zero-downtime reload of haproxy. This is cumbersome, as we get a very large memory spike during the reload, as the new instance reads in the full load of certs, and the old instance continues running.

We're currently looking at some of the capabilities of the HAProxy Unix Socket commands, and see the many things we can make dynamic (ACLs, Maps, etc). I'm wondering if there's a similar approach we can take to synchronize certs and avoid the constant reload behavior.

Using HAProxy 1.9 for experimenting, but we're not married to any particular version for this. Thanks for any help or suggestions!

Update I see the docs around manipulating bind here via the data-plane API, but it doesn't indicate explicitly how or when those changes get picked up. Since it includes a boolean for a forced reload (or defaulting to the reload-delay value if set) I'm guessing there's an assumption that at a reload is required.

If anyone has a citation to confirm the assumption this I'd be grateful.

已采纳解答

原帖链接 · banjaxed · CC BY-SA 4.0

In HAProxy 2.1 (Nov 2019), a new feature allows you to change TLS certificates without requiring a reload: https://www.haproxy.com/blog/dynamic-ssl-certificate-storage-in-haproxy/

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-09-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。