内网环境配置自签名 https
資深大佬 : nikola 45
内网环境,通过 nginx 暴露 https 端口,并托管 html 静态文件。
通过 openssl 生成证书
其中alt_names部分可以设置为域名或者地址
[ alt_names ] DNS.1 = mydomain.com DNS.2 = *.dydomain.com IP.1 = 172.16.7.1
nginx.conf 证书部分配置如下
ssl on; ssl_certificate /home/https/mydomain.crt; ssl_certificate_key /home/https/mydomain.key.pem;
当我在 chrome 当中导入 ca.pem 根证书之后,通过 ip 访问主页https://172.16.7.1时证书已经生效 http://ww1.sinaimg.cn/large/6a8d59c6gy1gb2tdx9sbaj20b10dpgls.jpg
然而当我本地配置 hosts,172.16.7.1 mydomain.com,浏览器通过域名访问https://mydomain.com时却无法访问了,有人能够解释下这是什么原理吗?
大佬有話說 (2)