Skip to content

Instantly share code, notes, and snippets.

@comynli
Created September 17, 2013 02:02
Show Gist options
  • Save comynli/6589214 to your computer and use it in GitHub Desktop.
Save comynli/6589214 to your computer and use it in GitHub Desktop.
自签名证书
openssl genrsa -des3 -out ca.key 2048 #生成跟证书私钥
openssl req -new -x509 -days 365 -key ca.key -out ca.crt #生成根证书
openssl genrsa -des3 -out ${name}.key 2048 #生成私钥
openssl req -new -key ${name}.key -out ${name}.csr #生成证书请求文件
openssl x509 -req -in ${name}.csr -out ${name}.crt -sha1 -CA ca.crt -CAkey ca.key -CAcreateserial -days 365 #自签名
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment