Skip to content

Instantly share code, notes, and snippets.

@hidepin
Last active July 8, 2016 13:20
Show Gist options
  • Select an option

  • Save hidepin/2e867059d523897537ca7444ca31cece to your computer and use it in GitHub Desktop.

Select an option

Save hidepin/2e867059d523897537ca7444ca31cece to your computer and use it in GitHub Desktop.
  1. 鍵の作成
$ openssl genrsa -aes128 2048 > localhost.key
Generating RSA private key, 2048 bit long modulus
....................+++
................................+++
e is 65537 (0x10001)
Enter pass phrase: <パスフレーズ>
Verifying - Enter pass phrase: <パスフレーズ>
  1. 証明書の作成
$ openssl req -utf8 -new -key localhost.key -x509 -days 3650 -out localhost.crt -set_serial 0
Enter pass phrase for localhost.key: <パスフレーズ>
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]: <都道府県名>
Locality Name (eg, city) []: <都市名>
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <会社名/組織名>
Organizational Unit Name (eg, section) []: <部門名>
Common Name (e.g. server FQDN or YOUR name) []: <FQDN>
Email Address []: <管理者メールアドレス>
  1. 秘密鍵からパスフレーズの削除
openssl rsa -in localhost.key -out key-no-password-localhost.key
Enter pass phrase for localhost.key: <パスフレーズ>
writing RSA key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment