安装openSSL:
[root@localhost ~]# yum list |grep open
[root@localhost ~]# yum install openssl.x86_64 -y
生成SSL证书:
制作私钥证书key:
openssl genrsa -des3 -out js.key 2048
[root@localhost ~]# openssl genrsa -des3 -out js.key 2048
要求输入密码,要记住该密码后面需要用,在使用证书的地方也需要用
制作公钥证书crt:
openssl req -new -x509 -days 365 -key js.key -out js.crt
生成签名证书js.crt
使用自签名证书签名服务器证书:
openssl genrsa -out server.key 2048 //生成服务器私钥server.key
openssl req -new -key server.key -out server.csr //生成服务器证书请求server.csr
openssl x509 -req -days 365 -in server.csr -CA js.crt -CAkey js.key -set_serial 01 -out server.crt //生成服务器证书
验证证书有效性:
.crt格式证书转pem
[root@localhost ~]# openssl x509 -in server.crt -out server.pem
页面更新:2024-05-30
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号