STunnel 不读取配置文件

Mar*_*utz 4 linux ssl stunnel

我按照stunnel: SSL-to-SSL? (对于 smtp/imap) 并具有以下配置文件:

cert = /home/marshall/stunnels/certs/umistunnel.keys

; protocol version (all, SSLv2, SSLv3, TLSv1)
sslVersion = SSLv3

pid = ./stunnel4.pid

[https]
accept  = 4433
connect = 3000
Run Code Online (Sandbox Code Playgroud)

当我跑

> stunnel config.conf
Run Code Online (Sandbox Code Playgroud)

我得到的错误是:

Reading configuration from descriptor 3
Snagged 64 random bytes from /home/marshall/.rnd
Wrote 1024 new random bytes to /home/marshall/.rnd
PRNG seeded successfully
Line 1: End of section stunnel: SSL server needs a certificate
Run Code Online (Sandbox Code Playgroud)

如果我改为运行:

> stunnel filethatdoesnotexist.asdf
Run Code Online (Sandbox Code Playgroud)

我得到相同的结果。而且,如果我在没有任何参数的情况下运行 stunnel,唯一的变化是错误指出第 0 行。我在这里做错了什么?

小智 12

您的系统上可能同时安装了 stunnel3 和 stunnel4。

“stunnel”的默认设置是将其软链接到 stunnel3:

root@sibelius:/usr/bin# ls -l stunnel*
lrwxrwxrwx 1 root root      8 Oct 18  2011 stunnel -> stunnel3
-rwxr-xr-x 1 root root   2797 Oct 18  2011 stunnel3
-rwxr-xr-x 1 root root 109904 Oct 18  2011 stunnel4
Run Code Online (Sandbox Code Playgroud)

stunnel3 的 stunnel.conf 的语法与 stunnel4 的语法不兼容。

因此错误。尝试删除 stunnel3。


Mar*_*utz 6

发现我的问题......它并没有真正记录在案(至少在我的 Ubuntu 系统上)。如果我运行命令

> stunnel4 config.conf
Run Code Online (Sandbox Code Playgroud)

然后一切正常,所有输出都显示在调试日志文件中(如果在配置文件中配置)。