1、自建CA#cd/etc/pki/CA/#(umask077;opensslgenrsa-outprivate/cakey.pem2048)#opensslreq-new-x509-keypriva
.
1、自建CA
# cd /etc/pki/CA/# (umask 077; openssl genrsa -out private/cakey.pem 2048)# openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 3656Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:YunnanLocality Name (eg, city) [Default City]:KunmingOrganization Name (eg, company) [Default Company Ltd]:SanOrganizational Unit Name (eg, section) []:StudentsCommon Name (eg, your name or your server's hostname) []:ca.san.comEmail Address []:[email protected]# ls -lh总用量 20K-rw-r--r--. 1 root root 1.4K 3月 29 16:18 cacert.pem# touch serial index.txt serial# echo 01 > serial # lscacert.pem certs crl index.txt newcerts private serial
2、证书签署
# (umask 077; openssl genrsa -out /root/mykey2.pri 2048) #生成一个私钥# openssl req -new -key /root/mykey2.pri -out /root/myreq.csr #生成证书Country Name (2 letter code) [XX]:CNState or Province Name (full name) []:YunnanLocality Name (eg, city) [Default City]:KunmingOrganization Name (eg, company) [Default Company Ltd]:SanOrganizational Unit Name (eg, section) []:StudentsCommon Name (eg, your name or your server's hostname) []:www.san.comEmail Address []:[email protected] enter the following 'extra' attributesto be sent with your certificate requestA challenge password []:An optional company name []:# openssl ca -in myreq.csr -out mycert.crt -days 365签署证书# lsmycert.crt #证书签署完成