如何在不重新启动的情况下使 stunnel 重新加载证书文件?

Rog*_*ach 5 linux security ubuntu stunnel

我有一个带有 stunnel 的服务器,客户端连接到该服务器。每个客户端都有自己的自签名证书,该证书的副本位于服务器上的 CApath 目录中 - 所以我可以控制谁可以访问服务器,谁不能。

当我需要禁止某些客户端访问时,我会删除证书并运行“service stunnel4 restart”。它工作得很好,但它肯定会破坏重启时已经在进行的连接。

有没有办法让 stunnel 看到证书不再有效而不重新启动它?

Jer*_*y W 5

尝试 killall -HUP stunnel

2010.01.21 发布的4.30 版包含以下增强功能:

在 Unix 上使用 HUP 信号和在 Windows 上使用 GUI 重新加载优雅的配置。


小智 1

/etc/ssl/certs您可以为每个用户配置一个独占端口号,并将客户端证书放入具有该端口号的子目录中,例如/etc/ssl/certs/34221

使用该端口配置客户端 stunnel.conf。

每个端口启动一个 stunnel 服务器,其中stunnel.conf包含

cert = /etc/ssl/certs/myserver_cert.pem
CAfile = /etc/ssl/certs/cacert.pem
CApath = /etc/ssl/certs/34221
Run Code Online (Sandbox Code Playgroud)

然后您就已经分离了您的用户访问权限。