基于版本:openwrt 15.05
基于uhttpd-2015-11-08版本:
x.509证书
openwrt支持https访问
1. 选择对应包
<*> uhttpd-mod-tls... uHTTPd
<*> openssl-util........................... Open source SSL toolkit (utility)
<*> luci-ssl......................... Standard OpenWrt set with HTTPS support

2.制作证书
步骤1:生成密钥
命令:openssl genrsa 1024 > server.key
说明:这是用128位rsa算法生成密钥,得到server.key文件
步骤2: 生成证书请求
命令:openssl req -new -key server.key > server.csr
说明:这是用步骤1的密钥生成证书请求文件server.csr, 这一步提很多问题,一一输入(这个可以随便输啦!)
步骤3: 生成证书请求
命令:openssl req -x509 -days 365 -key server.key -in server.csr > server.crt
说明:这是用步骤1,2的的密钥和证书请求生成证书server.crt,-days参数指明证书有效期,单位为天
制作好的证书放入 package/network/services/uhttpd/files/uhttpd.crt
package/network/services/uhttpd/files/uhttpd.key
修改package/network/services/uhttpd/Makefile

3.默认强制https访问
修改package/network/services/uhttpd/files/uhttpd.init

网友评论