mkdir /ssl
cd /ssl
openssl req -new -x509 -days 208 -key ca.key -out ca.crt
填的可以随便
舉例:依照順序
AU
jackooobe
city
Internet Widgits Pty Ltd
IT
server_aa
asd@gmail.com
openssl genrsa -out server.key 2048
要弄 openssl.cnf 和 v3.ext
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
[req_distinguished_name]
countryName = Country Name (2 letter code)
countryName_default = AU
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = jackooobe
localityName = Locality Name (eg, city)
localityName_default = city
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = IT
commonName = server_aa
commonName_max = 64
[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:TRUE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
IP.1 = 192.168.0.10
IP.2 = 服務器IP
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage=digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName=@alt_names
[alt_names]
IP.1 = 192.168.0.10
IP.2 = 服務器IP
openssl req -new -days 208 -key server.key -out server.csr -config openssl.cnf
openssl x509 -days 208 -req -sha256 -extfile v3.ext -CA ca.crt -CAkey ca.key -CAcreateserial -in server.csr -out server.crt