生成key
openssl genrsa -out ssl.key 2048
生成證書(shū)請(qǐng)求
openssl req -new -key ssl.key -out ssl.csr
自簽名生成證書(shū)
openssl x509 -req -in sign.csr -extensions v3_ca -signkey sign.key -out sign.crt
具體參考 http://www.cnblogs.com/kyrios/p/tls-and-certificates.html