We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用 homebrew 安装的 nginx 默认配置文件 nginx.conf 所在目录为/usr/local/etc/nginx
创建存放 SSL 证书相关文件目录
cd /usr/local/etc/nginx mkdir ssl cd ssl
openssl genrsa -des3 -out server.key 2048
以上命令是基于 des3 算法生成的 rsa 私钥,在生成私钥时必须输入至少 4 位的密码
openssl rsa -in server.key -out server.key
openssl req -new -x509 -key server.key -out ca.crt -days 3650
openssl req -new -key server.key -out server.csr
命令的执行过程中依次输入国家、省份、城市、公司、部门及邮箱等信息
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey server.key -CAcreateserial -out server.crt
server { listen 80; server_name localhost; listen 443 ssl; ssl_certificate /usr/local/etc/nginx/ssl/server.crt; ssl_certificate_key /usr/local/etc/nginx/ssl/server.key; ...... }
sudo nginx -s reload
修改 /etc/hosts 文件,实现映射
vim /etc/hosts # 添加本地 https 测试域名 ip 映射 127.0.0.1 localdomain.test
此时访问 https://localdomain.test/,提示无法访问。Chrome 也没有“忽略证书继续前往”的选项,需要我们在系统上添加自签名证书到系统并修改为始终信任
https://localdomain.test/
*.cer
直接在页面输入 thisisunsafe 即可继续访问
thisisunsafe
The text was updated successfully, but these errors were encountered:
非常清晰
Sorry, something went wrong.
No branches or pull requests
一、生成私钥(server.key)和 crt 证书(server.crt)
创建存放 SSL 证书相关文件目录
以上命令是基于 des3 算法生成的 rsa 私钥,在生成私钥时必须输入至少 4 位的密码
命令的执行过程中依次输入国家、省份、城市、公司、部门及邮箱等信息
二、配置 nginx 支持 https 协议
三、Mac 配置 ip 域名映射
修改 /etc/hosts 文件,实现映射
此时访问
https://localdomain.test/
,提示无法访问。Chrome 也没有“忽略证书继续前往”的选项,需要我们在系统上添加自签名证书到系统并修改为始终信任四、设置 Mac 信任自签名证书
*.cer
文件*.cer
文件,会出来一个安装对话框,选择安装到 “系统” 钥匙串拓展:不信任网页暴力解决方法
直接在页面输入
thisisunsafe
即可继续访问The text was updated successfully, but these errors were encountered: