1、使用 mkcert-v1.4.4-windows-amd64.exe
1 # 进入到mkcert-v1.4.4-windows-amd64.exe下载文件位置 2 # 执行命令 3 ./mkcert-v1.4.4-windows-amd64.exe *.game.local aiPlatform.dev localhost 127.0. 0.1 ::1 192.168.1.78 4 # *.game.local 本地域名 5 # localhost 127.0.0.1 ::1 192.168.1.78 本地ip地址
1 # 安装证书 2 ./mkcert-v1.4.4-windows-amd64.exe -install
# 将证书复制到自己站点目录,或者直接地址指向过来 # nginx 部署 ssl on; ssl_certificate E:/Project/game/game-admin/ssl/_wildcard.game.local+5.pem; ssl_certificate_key E:/Project/game/game-admin/ssl/_wildcard.game.local+5-key.pem;
验证
2、openssl
# 生成私钥 openssl genpkey -algorithm RSA -out server.key # 生成证书签名请求(CSR) openssl req -new -key server.key -out server.csr -subj "/CN=*.game.local" # 创建配置文件(openssl.cnf) echo "subjectAltName=DNS:*.game.local" > openssl.cnf # 生成自签名证书 openssl x509 -req -days 3650 -in server.csr -signkey server.key -extfile openssl.cnf -out server.crt # 将server.crt、server.key复制到站点目录,或者自定证书存储文件夹 # 部署 server { listen 443 ssl; server_name *.game.local; ssl_certificate E:/Project/game/game-admin/ssl/server.crt; ssl_certificate_key E:/Project/game/game-admin/ssl/server.key; # 其他 SSL 配置,例如强制 HTTPS、TLS 版本等 location / { # 配置你的站点 } }
标签:宝塔,windows,openssl,server,ssl,game,key,local From: https://www.cnblogs.com/chenjiangbin/p/17995799