为什么 stunnel 会这样做

为什么 stunnel 会这样做

我正在尝试设置 stunnel 来加密来自 rsyslog 的流量(使用 relp 协议),但是每当我尝试启动 stunnel 并将日志发送到远程服务器时,我都会收到以下信息:

    Remote socket (FD=13) closed
    Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Local socket (FD=3) closed
    Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Service [ssyslog] finished (0 left)
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316320512]: Service [ssyslog] accepted (FD=3) from 127.0.0.1:42481
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Service [ssyslog] started
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Waiting for a libwrap process
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Acquired libwrap process #0
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Releasing libwrap process #0
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Released libwrap process #0
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Service [ssyslog] permitted by libwrap from 127.0.0.1:42481
Feb 15 01:25:55 ruby stunnel: LOG5[26750:140598316271360]: Service [ssyslog] accepted connection from 127.0.0.1:42481
Feb 15 01:25:55 ruby stunnel: LOG6[26750:140598316271360]: connect_blocking: connecting 98.235.203.58:60514
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: connect_blocking: s_poll_wait 98.235.203.58:60514: waiting 10 seconds
Feb 15 01:25:55 ruby stunnel: LOG5[26750:140598316271360]: connect_blocking: connected 98.235.203.58:60514
Feb 15 01:25:55 ruby stunnel: LOG5[26750:140598316271360]: Service [ssyslog] connected remote server from 78.46.65.138:43235
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: Remote socket (FD=13) initialized
Feb 15 01:25:55 ruby stunnel: LOG7[26750:140598316271360]: SNI: host name: xx.xx.xx.xx
Feb 15 01:25:55 ruby stunnel: LOG3[26750:140598316271360]: SSL_connect: Peer suddenly disconnected
Feb 15 01:25:55 ruby stunnel: LOG5[26750:140598316271360]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket

一遍又一遍地快速连续地出现这种情况,有人知道我该如何找出导致这种情况发生的原因吗?过去几个小时我一直在试图弄清楚这一点,但目前还不知道该怎么做

答案1

好吧,在谷歌上胡言乱语和徒劳无功地搜索之后,我终于找到了原因。不知道是我太傻了,还是这是正常现象,但远程服务器正在监听一个端口(比如说 60000),但出于某种原因,即使我告诉客户端连接到 60000,它仍继续尝试连接到 60001,所以我只需告诉客户端连接到端口 59999,它就可以完美地工作了 :)

答案2

编辑:此处不适用,但如果您在尝试调试 http/https 的类似问题时偶然发现了此线程:请确保在浏览器/客户端中输入 https 而不是 http。当有人访问 http 时,Stunnel 不会自动重定向到 https

相关内容