找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 32628|回复: 26

终于搞定LEDE的HTTPS

  [复制链接]
发表于 2017-4-22 15:37 | 显示全部楼层 |阅读模式
本帖最后由 ypjalt 于 2017-4-23 10:45 编辑

论坛里有一篇,不过是生成v1版本的证书,现在的Chrome都不认了,折腾了一天,查找了很多资料,终于不完美的搞定了更改/etc/config/uhttpd 里的 option redirect_https '0',可以实现http与https共存

登陆SSH
首先安装opkg install luci-ssl-openssl
修改/etc/ssl/openssl.cnf

req_extensions = v3_req # The extensions to add to a certificate request
[ v3_req ]


# Extensions to add to a certificate request


basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names


[ alt_names ]
IP.1= 192.168.3.1
DNS.1 = 192.168.3.1



上面设置自己的路由器IP或者直接改为192.168.3.1
在SSH中输入,一条一条来,
中间要输入的可以参照这帖子,我就没截图了:http://www.jianshu.com/p/045f95c008a0

openssl genrsa -des3 -out root.key 2048
openssl req -new -key root.key -out root.csr
openssl x509 -req -days 3650 -sha256 -extfile /etc/ssl/openssl.cnf -extensions v3_ca -signkey root.key -in root.csr -out root.crt

openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 3650 -sha256 -extfile /etc/ssl/openssl.cnf -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in server.csr -out server.crt
openssl rsa -in server.key -out server.key.unsecure

openssl genrsa -des3 -out client.key 2048
openssl req -new -key client.key -out client.csr
openssl x509 -req -days 3650 -sha256 -extfile /etc/ssl/openssl.cnf -extensions v3_req -CA root.crt -CAkey root.key -CAcreateserial -in client.csr -out client.crt

/etc/init.d/uhttpd restart

在root文件会生成下方的文件



然后
把server.crt server.key.unsecure改名uhttpd.crt  uhttpd.key.unsecure复制到/etc下


修改/etc/config/uhttpd

option cert '/etc/uhttpd.crt'
option key '/etc/uhttpd.key.unsecure'

电脑或手机安装root.crt和client.crt
重启下路由器,输入路由器的IP地址,就可以看见安全的标志了









本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2017-4-22 16:11 | 显示全部楼层
好文章,赞一个
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 16:41 | 显示全部楼层
直接不启用HTTPS不就行了。。。。生成证书多麻烦,直接一个脚本执行就行啦
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 16:47 | 显示全部楼层
谢谢楼主分享!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-22 16:48 | 显示全部楼层
血洗刀锋 发表于 2017-4-22 16:41
直接不启用HTTPS不就行了。。。。生成证书多麻烦,直接一个脚本执行就行啦

因为kp,安装了        libustream-openssl,显示不安全,强迫症受不了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 16:50 | 显示全部楼层
ypjalt 发表于 2017-4-22 16:48
因为kp,安装了        libustream-openssl,显示不安全,强迫症受不了

直接去config注释掉https就行了,不需要那么麻烦的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-4-22 16:52 | 显示全部楼层
血洗刀锋 发表于 2017-4-22 16:50
直接去config注释掉https就行了,不需要那么麻烦的

好吧,但这还是有用的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 18:52 | 显示全部楼层
非常有用,刚才试了一下,也成功了。感谢!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 20:05 | 显示全部楼层
顶一顶,膜拜大神
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 21:12 | 显示全部楼层
厉害了 大神 这个必须支持一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 22:04 | 显示全部楼层
本帖最后由 kohillyang 于 2017-4-22 22:06 编辑

http://notes.kohill.cn/add_https_for_web_server其实就两步:1. 签发证书(关于let's encrypt有一键脚本)
                    2. 设置证书路径
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-22 23:28 | 显示全部楼层
openssl genrsa -des3 -out root.key 2048
第一条命令就出错了

Error relocating /usr/bin/openssl: BIO_f_zlib: symbol not found
Error relocating /usr/bin/openssl: COMP_zlib_cleanup: symbol not found
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-23 14:44 | 显示全部楼层
谢谢楼主分享!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-23 23:32 | 显示全部楼层
好腻害顶你
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-4-24 07:32 | 显示全部楼层
好文章,赞一个
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-28 21:43

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表