LoginSignup
9
8

More than 5 years have passed since last update.

SSL証明書の整合性チェック

Last updated at Posted at 2018-10-01

クライアントが取得したSSL証明書をもらって、Nginxに設定する機会があり
念の為、サーバ証明書と中間証明書、秘密鍵の整合性をチェックして設定したのでメモ。

中間証明書を結合

cat [サーバ証明書].crt [中間証明書].crt [ルート証明書].crt > example.com.crt

(多分ルート証明書は結合する必要ないと思うけど)

サーバ証明書と秘密鍵の整合性チェック

ハッシュ値が同じかチェック

$ openssl x509 -noout -modulus -in [サーバ証明書].crt | md5sum
fe63769fada85ad811f33a5782c15db6  -

$ openssl rsa -noout -modulus -in [秘密鍵].key | md5sum
fe63769fada85ad811f33a5782c15db6  -

サーバ証明書と中間証明書の整合性チェック

ハッシュ値が同じかチェック

$ openssl x509 -issuer_hash -noout -in [サーバ証明書].crt
8d28ae65

$ openssl x509 -subject_hash -noout -in [中間証明書].crt
8d28ae65

サーバ証明書の有効期限チェック

$ openssl x509 -noout -dates -in [サーバ証明書]
notBefore=Sep 28 00:00:00 2018 GMT
notAfter=Sep 28 23:59:59 2019 GMT
9
8
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
9
8