Stunnel-为不支持https(ssl)的web服务器提供https(ssl)服务

Stunnel介绍

1.跨平台软件
2.依赖OpenSSL或SSLeay以实现TLS或SSL协议
3.为无法提供TLS或SSL服务的WEB服务器提供TLS或SSL服务,如thttpd不能提供TLS或SSL服务

下面是Stunnel为thttpd提供SSL服务的方法。

如何使用Stunnel

环境

OS: Ubuntu16.04
WebServer: thttpd

安装

下载:

下载stunnel-5.56.tar.gz
地址 https://www.stunnel.org/downloads.html

解压后编译安装:

./configure
make && make install

生成证书

cd /usr/local/etc/stunnel/
sudo openssl req -new -x509 -days 3650 -nodes -out stunnel.pem -keyout stunnel.pem

配置文件

vi /usr/local/etc/stunnel/stunnel.conf

内容:

[https]
accept = 8080 #8080是stunnel服务端口号,即浏览器访问时的端口号
connect = 8888 #8888是thttpd服务端口号
cert = /usr/local/etc/stunnel/stunnel.pem #之前生成的证书

如下图(分号;是注释):


stunnelconf.png

启动

cd /usr/local/etc/stunnel
stunnel stunnel.conf

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容