求真百科歡迎當事人提供第一手真實資料,洗刷冤屈,終結網路霸凌。

Stunnel查看源代码讨论查看历史

跳转至: 导航搜索
Stunnel

软件名称: Stunnel

性 质: 跨平台软件

是否收费: 免费

用 途: 提供全局的TLS/SSL服务

实行协议: TLS或SSL

Stunnel是一个自由的跨平台软件,用于提供全局的TLS/SSL服务。针对本身无法进行TLS或SSL通信的客户端及服务器,Stunnel可提供安全的加密连接。该软件可在许多操作系统下运行,包括Unix-like系统,以及Windows。Stunnel依赖于某个独立的库,如OpenSSL或者SSLeay,以实现TLS或SSL协议。[1]

简介

最佳助手

要实现的TLS或SSL协议如下

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文件内容

  1. Use it for client mode

client = yes

  1. Client-level configuration

[ 应用服务名称 ]

accept =本地IP : 目标端口

connect =Server端IP : 指定的端口 # Use it for server mode

client = no

  1. Server-level configuration

[ 应用服务名称 ]

accept = 指定的端口

connect =目标服务器IP : 目标端口

常见应用实例:

Stunnel.conf文件配置比较简单,下面我们介绍一些常见应用配置,其中Client端是放在本机,IP是127.0.0.1,Server端是放在外网的服务器上,IP是202.151.90.28。

1.加密邮件传输:

加密邮件,需要将发送和接收的过程都要进行保护,那么我们就要对POP3和SMTP传送方式进行加密。如果我们有一个信箱,服务器的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

如果有多个邮件传输需要加密,则增加相应的POP3和SMTP设置即可。设置好了配置文件,我们还需要将邮件客户端(常见的为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,既可以做到对网络的安全检测,并找出网络内的潜在安全隐患,又能从防护的角度出发,保护公司内部网络的重要信息。此方案成本低,不改变当前网络内的结构,容易实施,是一个简单有效的安全管理方案。

参考来源