SSL取得・更新のためのCSR作成手順
いざ更新するときによく忘れるのでめも。
# 一応バージョンを確認しておくopenssl version
# CSRを生成するフォルダに移動(フォルダは事前に作成しておく)/Users/jba_mn2000002/Desktop/csr
# 秘密鍵を作成(以下ファイル名はsample2022として作成)openssl genrsa -des3 -out sample2022.key.org 2048..Enter pass phrase for sample2022.key.org: (任意のパスフレーズを入力)Verifying - Enter pass phrase for sample2022.key.org: (上記と同じものを入力)
# 作成した.keyファイルのパスフレーズを解除openssl rsa -in sample2022.key.org -out sample2022.key
# 上記で指定したパスフレーズを入力Enter pass phrase for sample2022.key.org: (設定したパスフレーズを入力)
# CSRファイルを作成openssl req -new -key sample2022.key -out sample2022.csr
You are about to be asked to enter information that will be incorporatedinto 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 blankFor some fields there will be a default value,If you enter '.', the field will be left blank.
(以下、必要項目を入力)
Country Name (2 letter code) [AU]:JP //2文字国コードState or Province Name (full name) [Some-State]:Osaka //所在地の都道府県名Locality Name (eg, city) []:Osaka-city //所在地の市区町村名Organization Name (eg, company) [Internet Widgits Pty Ltd]:Sample inc. //組織、会社名Organizational Unit Name (eg, section) []: //部署部門名(入力は任意)Common Name (e.g. server FQDN or YOUR name) []:sample.com //SSLを適用するドメインEmail Address []: //入力不要
Please enter the following 'extra' attributesto be sent with your certificate requestA challenge password []: //入力不要An optional company name []: //入力不要
ディレクトリ以下、下記のファイルが生成されていれば成功。
sample2022.key.orgsample2022.keysample2022.csr ←これがCSRファイル
(念のため)CSRの内容を確認するコマンドは下記。
openssl req -text -noout -in sample2022.csr