認証局の鍵を作成。
$ sudo openssl genrsa -out ca.key 1024
認証局の証明書を作成。
$ sudo openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Tokyo
Locality Name (eg, city) []:Shibuya-ku
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Masaki KOMAGATA
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:Masaki KOMAGATA
Email Address []:[email protected]
認証局が発行する証明書のシリアルナンバーを作成。
$ echo 01 > ca-cert.srl
認証局を使って証明書を発行。
$ sudo openssl x509 -CA ca.crt -CAkey ca.key -CAserial ca-cert.srl -req -days 3650 -in server.csr -out server.crt