LoginSignup
1
2

More than 3 years have passed since last update.

オレオレ証明書の警告をChromeで表示させないようにする

Last updated at Posted at 2020-10-09

目的

オレオレ証明書の警告をChromeで表示させないようにする。
ドメインは ore.example.com とする。

手順

ホスト側の hosts 変更

以下の設定を追加する。※Windows10の場合

/C/Windows/System32/drivers/etc/hosts

127.0.0.1 ore.example.com

SSL証明書を作成

秘密鍵を作成

openssl genrsa -out ore.example.com.server.key 2048

証明書署名要求(CSR Certificate Signing Request)を作成

openssl req -new -key ore.example.com.server.key -out ore.example.com.server.csr

Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Tokyo
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) []:ore.example.com
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

SAN値を設定

ドメインはワイルドカードにしている。※ore.example.com にすると動かなかった
IPはホストのローカルエリアネットワークのIPアドレスにしている。※適宜変更

echo "subjectAltName = DNS:*.example.com, IP:192.168.xxx.xxx" > san.txt

サーバ証明書を作成

openssl x509 \
  -req \
  -sha256 \
  -days 3650 \
  -signkey ore.example.com.server.key \
  -in ore.example.com.server.csr \
  -out ore.example.com.server.crt \
  -extfile san.txt

(オプション)サーバ証明書を確認

openssl x509 -in ore.example.com.server.crt -text -noout

オレオレ証明書を Chrome に登録する

  1. Chrome の設定を開く。
  2. プライバシーとセキュリティメニューのセキュリティを選択する
  3. 証明書の管理を選択する(設定ボックスが表示される)
  4. 設定ボックスでインポートをクリックする
  5. 説明の画面で次へをクリックする
  6. さきほど作成したore.example.server.crtファイルを選択して次へをクリックする
  7. 証明書ストアを 信頼されたルート証明機関 に変更して次へをクリックする
  8. 最終確認画面で完了をクリックする
  9. セキュリティ警告が出る場合ははいをクリックする
1
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
1
2