LoginSignup
35

More than 5 years have passed since last update.

自己証明書のhttpsサイトで証明書エラーを非表示にする手順

Last updated at Posted at 2014-07-23

Apache+OpenSSLで簡単に自己認証したい - Qiitaを元にやってみた。

あと以前書いた記事: クライアント証明書を要求するサイトの構築(Apache+OpenSSL)その1 - Qiita

yum install -y httpd mod_ssl
cd /opt

鍵の生成

秘密鍵(key)の生成

openssl genrsa \
  -out server.key 2048

証明書 署名要求(csr)の生成

csrの生成
openssl req \
  -new \
  -key server.key \
  -out server.csr \
  -subj "/C=JP/ST=Tokyo/L=Tokyo/O=super_office.jp/OU=Web/CN=$(hostname)"

csrに署名しサーバ証明書(crt)を生成

有効期間3650日
openssl x509 \
  -in server.csr \
  -days 3650 \
  -req  \
  -signkey server.key > server.crt

httpdの設定

httpsは公開鍵(csr)と証明書(crt)にて動作する。

/etc/httpd/conf.d/ssl.conf
- SSLCertificateFile /etc/pki/tls/certs/localhost.crt
- SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
+ SSLCertificateFile /opt/server.crt
+ SSLCertificateKeyFile /opt/server.key

IEで証明書エラーを非表示にする

  • いわゆるこいつ

スクリーンショット 2014-07-23 13.52.32.png

  • webサーバから持ってきた「server.crt」をwindowsでダブルクリック

スクリーンショット 2014-07-23 13.52.07.png

  • ルート証明書のインストール時、次へ次へと進むと「中間証明機関」に入ってしまうので手動で指定。

スクリーンショット 2014-07-23 13.53.27.png

スクリーンショット 2014-07-23 13.53.34.png

画面確認

  • 警告無く表示できることを確認。

スクリーンショット 2014-07-23 13.53.51.png

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
35