生成一个文件名字:v3.ext
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
extendedKeyUsage = serverAuth
[alt_names]
DNS.1 = domain.com
# IP address
IP.1 = 192.168.0.XXX
IP.2 = 127.0.0.1
生成私钥key文件
openssl genrsa 1024 > /path/to/private.pem
通过私钥文件生成CSR证书签名
openssl req -new -key /path/to/private.pem -out csr.pem
Generating RSA private key, 1024 bit long modulus
...........++++++
..++++++
e is 65537 (0x10001)
Enter pass phrase for client.key:12345
Verifying - Enter pass phrase for client.key:12345
openssl req -new -key client.key -out client.csr -config openssl.cnf
[root@airwaySSL bin]# openssl req -new -key client.key -out client.csr -config openssl.cnf
Enter pass phrase for client.key:12345