[root@ca ~]# openssl ca -keyfile /etc/pki/CA/private/cakey.pem -cert /etc/pki/CA/cacert.pem -in /tmp/server.csr -out /server.crt
Using configuration from /etc/pki/tls/openssl.cnf
Enter pass phrase for /etc/pki/CA/private/cakey.pem:
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 14709139257483550390 (0xcc215c38ea0f5eb6)
Validity
Not Before: Apr 24 05:37:55 2019 GMT
Not After : Apr 23 05:37:55 2020 GMT
Subject:
countryName = CN
stateOrProvinceName = beijing
organizationName = zh
organizationalUnitName = IT
commonName = ca
emailAddress = 1@163.com
X509v3 extensions:
X509v3 Basic Constraints:
CA:TRUE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
9A:8E:97:F4:FF:74:A0:09:5F:B1:A7:26:0B:7C:DB:80:AC:3E:4E:CC
X509v3 Authority Key Identifier:
keyid:3F:BF:48:24:36:AE:E6:0D:B4:D9:B9:64:8D:D9:3D:68:EB:AC:0D:47
Certificate is to be certified until Apr 23 05:37:55 2020 GMT (365 days)
Sign the certificate? [y/n]:y
failed to update database
TXT_DB error number 2
原因是commonName 跟前面生成ca文件和server 密钥commonname相同导致,可以换一个commonname就可以了.