在上篇文章中,我们已经学会了如何给本地的虚拟域名添加https证书
今天想到给自己的黑群晖加个https证书
我的黑群晖为`http://192.168.2.217:5000`
加上证书后为`https://192.168.2.217:5001`
如何实现,实现以下代码生成证书
```
openssl req -x509 -out 217.crt -keyout 217.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=192.168.2.217' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
```
然后打开群晖
控制面板|安全性|证书|新增|添加新证书
![](https://www.yuanchengzhushou.cn/static/image/8118_1.jpg)
![](https://www.yuanchengzhushou.cn/static/image/8118_2.jpg)
![](https://www.yuanchengzhushou.cn/static/image/8118_3.jpg)
![](https://www.yuanchengzhushou.cn/static/image/8118_4.jpg)
![](https://www.yuanchengzhushou.cn/static/image/8118_5.jpg)