LoginSignup
2
2

Azure Application Gateway用のプライベート証明書作成手順メモ

Last updated at Posted at 2023-11-08

技術的に新しい内容が含まれている訳ではなく、初歩的な内容です

はじめに

Azure Application Gateway用のプライベート証明書を作成した手順をメモする

・証明書はSAN付きで発行
・PKCS12形式に変換する際にパスワードを付与

証明書作成手順

  1. ルートCA作成(プライベートCA作成)
  2. サーバ証明書作成

1. ルートCA作成(プライベートCA作成)

1.CA秘密鍵の作成
openssl ecparam -out test2023.key -name prime256v1 -genkey
2.自己証明(CSRの作成)
openssl req -new -sha256 -key test2023.key -out test2023.csr
3.ルートCA証明書の作成
openssl x509 -req -sha256 -days 365 -in test2023.csr -signkey test2023.key -out test2023.crt

上記は有効期限を365日、SHA256の設定例(要件に応じて変更する)

2. サーバ証明書作成

0. SANファイルの作成(viコマンドでsan.txtを作成)
vi san.txt
subjectAltName = DNS:agw.test-2023011.local, IP:10.1.1.1
1. サーバ秘密鍵の作成
openssl ecparam -out agw-svr.key -name prime256v1 -genkey
2.自己証明(CSRの作成)
openssl req -new -sha256 -key agw-svr.key -out agw-svr.csr
3.サーバ証明書の作成
openssl x509 -req -in agw-svr.csr -CA test2023.crt -CAkey test2023.key -CAcreateserial -out agw-svr.crt -days 365 -sha256 -extfile san.txt
4.証明書の検証
openssl x509 -in agw-svr.crt -text -noout
5. PKCS12への変換
openssl pkcs12 -export -in agw-svr.crt -inkey agw-svr.key -out agw-svr.pfx
パスワードを入力

Application Gatewayに上記PKCS12形式(pfx)の証明書をインポートする際にパスワードの入力が必須
(上記の「パスワードを入力」で空エンターをするとApplication Gatewayにインポートできない)

参考URL

Application Gateway の証明書
https://learn.microsoft.com/ja-jp/azure/application-gateway/renew-certificates#certificates-on-an-application-gateway

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2