Linux使用OpenSSL生成SSL证书

实现本地nginx ip+ssl的访问

注意openssl和ssh-keygen的区别

~~## 生成私钥文件
openssl genrsa -des3 -out localhost.key 2048

去除口令,否则启动nginx时需要密码

openssl rsa -in localhost.key -out localhost.key~~

生成私钥 https://wenku.csdn.net/answer/36jsizdahy

openssl genrsa -out localhost.key 2048

创建请求证书

openssl req -new -key localhost.key -out localhost.csr

生成证书 自签名证书

openssl x509 -req -days 36500 -in localhost.csr -signkey localhost.key -out localhost

在线判断证书是否匹配

https://www.ssldun.com/tools/cert-key-matcher.php#results
image

posted @ 2023-12-29 18:01  学不会xuebuhui  阅读(361)  评论(0编辑  收藏  举报
Language: javascript