CSR from OpenSSL
首先產生 private.key (私密金鑰)
$ openssl genrsa -out private.key 2048
配合使用私鑰產生 CSR (certificate signing request) : 證書簽名
$ openssl req -new -sha256 -key private.key -out certreq.csr
Country Name (2 letter code) [XX]:TW
State or Province Name (full name) []:Taiwan
Locality Name (eg, city) [Default City]:Taipei
Organization Name (eg, company) [Default Company Ltd]:Example Inc
Organizational Unit Name (eg, section) []:Security Dept
Common Name (eg, your name or your server's hostname) []:www.example.com
# 電子郵件,可不填
Email Address []:
Please enter the following 'extra' attributes to be sent with your certificate request
# 用來產生部分的 CSR 內容,可不填,建議留白
A challenge password []:
# 公司別稱,可不填
An optional company name []:
產生證書文件 (透過 private key 與 證書簽名 .csr)
$ openssl x509 -req -in certreq.csr -signkey private.key -out certificate.pem