Stunnel

Stunnel是一個自由的跨平台軟體,用於提供全局的TLS/SSL服務。針對本身無法進行TLS或SSL通信的客戶端及伺服器,Stunnel可提供安全的加密連線。該軟體可在許多作業系統下運行,包括Unix-like系統,以及Windows。Stunnel依賴於某個獨立的庫,如OpenSSL或者SSLeay,以實現TLS或SSL協定

基本介紹

  • 軟體名稱:Stunnel
  • 性質:跨平台軟體
  • 是否收費:免費
  • 用途:提供全局的TLS/SSL服務
  • 實行協定:TLS或SSL
簡介,相關網站,

簡介

最佳助手
要實現的TLSSSL協定如下
Stunnel由Michal Trojnara 和 Brian Hatch負責維護,遵照GNU通用公共許可證進行發布。
Stunnel -- Universal SSL Wrapper
Stunnel is a program that allows you to encrypt arbitrary TCP connections inside SSL (Secure Sockets Layer) available on both Unix and Windows. Stunnel can allow you to secure non-SSL aware daemons and protocols (like POP, IMAP, LDAP, etc) by having Stunnel provide the encryption, requiring no changes to the daemon's code.
The Stunnel source code is not a complete product -- you still require a functioning SSL library such as OpenSSL or SSLeay in order to compile stunnel. This means that stunnel can support whatever (and only) that which your SSL library can, without making any changes in the Stunnel code.
The Stunnel source code is available under the GNU General Public License, meaning it is free to use in both commercial and non commercial applications as you see fit, as long as you provide source code (and any modifications) with the software. Your compiled Stunnel binary is 'restricted' by whatever license your chosen SSL library is under, however both OpenSSL and SSLeay are open source and similarly liberal in their licensing.

相關網站

Stunnel是一款免費的工具,可以在這裡下載。下面我們介紹一下具體的使用。
下載Stunnel Client端程式,並解壓到本機的C:\Program Files目錄下。
下載Stunnel Server端程式,並解壓後放在外網的伺服器上。
分別配置stunnel.conf檔案。
更改本機應用程式的網路連線配置。
分別運行stunnel.-4.04.exe執行檔案。
說明:
我們使用Stunnel,需要在外網有一台有管理許可權的伺服器,來運行Stunnel的Server程式。配置好Stunnel.conf後,可將執行檔案在啟動選單中建立捷徑,這樣讓每次開機時,能自動運行。Stunnel技術是將傳輸的信息加密後,通過Server端的伺服器進行解密才到達的目的主機,所以在選擇Server端伺服器的時候,對伺服器的頻寬速度有一定的要求。
Stunnel的配置:
Client和Server端都包含stunnel.conf配置檔案,格式如下表所示:
Client端stunnel.conf檔案內容 Server端stunnel.conf檔案內容
# Use it for client mode
client = yes
#Client-level configuration
[ 套用服務名稱 ]
accept =本地IP : 目標連線埠
connect =Server端IP : 指定的連線埠 # Use it for server mode
client = no
#Server-level configuration
[ 套用服務名稱 ]
accept = 指定的連線埠
connect =目標伺服器IP : 目標連線埠
常見套用實例:
Stunnel.conf檔案配置比較簡單,下面我們介紹一些常見套用配置,其中Client端是放在本機,IP是127.0.0.1,Server端是放在外網的伺服器上,IP是202.151.90.28。
1.加密郵件傳輸:
加密郵件,需要將傳送和接收的過程都要進行保護,那么我們就要對POP3SMTP傳送方式進行加密。如果我們有一個信箱,伺服器的IP是202.108.44.153,配置檔案stunnel.conf如下:
Client端SMTP和POP3檔案內容 Server端SMTP和POP3檔案內容
[smtp.accept = 127.0.0.1:25
connect = 202.151.90.28:125
[pop3.
accept = 127.0.0.1:110
connect = 202.151.90.28:1110 [smtp.
accept = 125
connect = 202.108.44.170:25
[pop3.accept = 1110
connect = 202.108.44.153:110
如果有多個郵件傳輸需要加密,則增加相應的POP3SMTP設定即可。設定好了配置檔案,我們還需要將郵件客戶端(常見的為Foxmail或Outlook)與其對應,設定如下:
傳送的郵件地址改為:127.0.0.1 連線埠改為:125
接收的郵件地址改為:127.0.0.1 連線埠改為:1110
2.加密FTP傳輸:
FTP是比較早的檔案傳輸協定,內容都是以明文方式傳輸,我們利用Stunnel後,也可以讓FTP的傳輸非常安全,現在我們只需要在前面的stunnel.conf內容裡面增加以下配置信息:
Client端FTP的配置 Server端FTP的配置
[ftp.accept = 127.0.0.1:21
connect = 202.151.90.28:121 [ftp.accept = 121
connect = 218.7.9.73:21
FTP軟體(如CuteFTP)也要做相應更改:
登錄的遠程地址改為:127.0.0.1 連線埠改為121
3.加密HTTP網站訪問傳輸:
我們不能對所有的網站訪問都進行加密,因為太多,但對於很重要的網站,我們也可以用Stunnel來保護訪問的內容不受到監聽。例如我們要訪問www.,網站IP位址是202.108.36.172,HTTP的配置如下:
Client端HTTP的配置 Server端HTTP的配置
[www.accept = 127.0.0.1:80
connect = 202.151.90.28:8080 [www.accept = 8080
connect = 202.108.36.172:80
通過結合使用科來網路分析系統與Stunnel,既可以做到對網路的安全檢測,並找出網路內的潛在安全隱患,又能從防護的角度出發,保護公司內部網路的重要信息。此方案成本低,不改變當前網路內的結構,容易實施,是一個簡單有效的安全管理方案。

相關詞條

熱門詞條

聯絡我們