创建文件夹
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
标签:浏览器,证书,IP,server,ext,key,csr From: https://www.cnblogs.com/wiseo/p/crt.html