Ssl

為什麼 stunnel 這樣做

  • August 11, 2014

我正在嘗試設置 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

一遍又一遍地快速連續,有人知道我怎麼能找出導致這種情況發生的原因嗎?在過去的幾個小時裡,我一直在試圖解決這個問題,但目前還不知道該怎麼做

好的,在Google上經過大量的詛咒和無結果的搜尋後,我能夠找出它是什麼。不確定我是否只是個白痴,或者這是否正常,但遠端伺服器正在偵聽埠(例如 60000)但出於某種原因,即使我告訴客戶端連接到60000,它一直試圖連接到 60001,所以我只需要告訴客戶端連接到埠 59999 並且它工作得很好:)

編輯:此處不適用,但如果您在嘗試調試 http/https 的類似問題時偶然發現此執行緒:請確保您在瀏覽器/客戶端中輸入 https 而不是 http。當有人訪問 http 時,Stunnel 不會自動重定向到 https

引用自:https://serverfault.com/questions/479074