window本机搭建https环境(两种方式)

发布时间 2023-12-28 20:13:23作者: 爵岚

一、(方式一)通过openssl 安装ssl证书搭建https

1.下载openssl http://slproweb.com/products/Win32OpenSSL.html
2.安装之后配置环境变量 OPENSSL_HOME …\bin Path变量末尾加;%OPENSSL_HOME%
3. 创建私钥 openssl genrsa -des3 -out name.key 1024 需要记住输入的密码 name为自定义的名字
4.创建ssr证书 openssl req -new -key name.key -out name.csr 需要输入一些列信息,最重要的是Common Name表示要使用https访问的域名
5.去除密码 复制name.key重命名为name.copy.key
6.执行openssl rsa -in name.copy.key -out name.key
7.生成crt证书 openssl x509 -req -days 365 -in test.csr -signkey name.key -out name.crt

 

8.修改nginx的配置文件