Loading

自签名证书实现浏览器IP证书访问

创建文件夹

mkdir ssl
cd ssl
#IP.2 改成自己电脑的IP地址或服务器IP
vi ext.ext
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName=@SubjectAlternativeName
 
[ SubjectAlternativeName ]
IP.1=127.0.0.1
IP.2=192.168.1.30
openssl req -new -newkey rsa:2048 -sha256 -nodes -out server.csr -keyout server.key -subj "/C=CN/ST=Beijing/L=Beijing/O=MY/OU=Web Security/CN=127.0.0.1"
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extfile ./ext.ext

在目录下出现: server.csr server.key server.crt

posted @ 2023-05-10 11:41  亚里士多智  阅读(207)  评论(0编辑  收藏  举报