SSL証明書に関するチェック方法
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Linux全般]]
~
*秘密鍵の内容を確認 [#aeb2889a]
# openssl rsa -text -noout -in 秘密鍵のファイル
*CSRの内容を確認 [#m6964492]
# openssl req -text -noout -in CSRファイル
*証明書の内容を確認 [#u1711a02]
# openssl x509 -text -noout -in 証明書ファイル
*証明書の内容とサーバーの鍵が一致するか確認 [#gdf70a63]
# openssl x509 -noout -modulus -in test.inamuu.com.crt |...
a996d8f2415ba36dc5eew0f0d190e274 -
# openssl rsa -noout -modulus -in test.inamuu.com.key | ...
a996d8f2415ba36dc5eew0f0d190e274 -
*証明書の鍵とサーバーにある鍵が一致するかを確認 [#bf0fa096]
openssl x509 -pubkey < server.crt
openssl rsa -pubout < server.key
-----BEGIN PUBLIC KEY----- 以降のデータが一致すればOK
*中間証明書の有効性を確認 [#af54f690]
パターン1
openssl verify -CAfile CAファイル < 証明書
stdin:OK
上記表示されればOK
パターン2
# openssl x509 -issuer_hash -noout -in test.inamuu.com.crt
79701ca5
# openssl x509 -subject_hash -noout -in test.inamuu.com....
79701ca5
一致すればOK。
*opensslコマンドで簡易サーバーを起動してチェック [#k58286...
$ openssl s_server -key 秘密鍵 -cert 証明書 -CAfile 中間...
※デフォルト4433ポート
※hostsに証明書で指定したコモンネームを127.0.0.1に向ける
ブラウザで、 https://コモンネーム:4433 へアクセス出来る...
~
参考URL:https://www.insaneworks.co.jp/kota/openssl-tips/
~
参考URL:https://www.skyarch.net/blog/?p=3376
終了行:
[[Linux全般]]
~
*秘密鍵の内容を確認 [#aeb2889a]
# openssl rsa -text -noout -in 秘密鍵のファイル
*CSRの内容を確認 [#m6964492]
# openssl req -text -noout -in CSRファイル
*証明書の内容を確認 [#u1711a02]
# openssl x509 -text -noout -in 証明書ファイル
*証明書の内容とサーバーの鍵が一致するか確認 [#gdf70a63]
# openssl x509 -noout -modulus -in test.inamuu.com.crt |...
a996d8f2415ba36dc5eew0f0d190e274 -
# openssl rsa -noout -modulus -in test.inamuu.com.key | ...
a996d8f2415ba36dc5eew0f0d190e274 -
*証明書の鍵とサーバーにある鍵が一致するかを確認 [#bf0fa096]
openssl x509 -pubkey < server.crt
openssl rsa -pubout < server.key
-----BEGIN PUBLIC KEY----- 以降のデータが一致すればOK
*中間証明書の有効性を確認 [#af54f690]
パターン1
openssl verify -CAfile CAファイル < 証明書
stdin:OK
上記表示されればOK
パターン2
# openssl x509 -issuer_hash -noout -in test.inamuu.com.crt
79701ca5
# openssl x509 -subject_hash -noout -in test.inamuu.com....
79701ca5
一致すればOK。
*opensslコマンドで簡易サーバーを起動してチェック [#k58286...
$ openssl s_server -key 秘密鍵 -cert 証明書 -CAfile 中間...
※デフォルト4433ポート
※hostsに証明書で指定したコモンネームを127.0.0.1に向ける
ブラウザで、 https://コモンネーム:4433 へアクセス出来る...
~
参考URL:https://www.insaneworks.co.jp/kota/openssl-tips/
~
参考URL:https://www.skyarch.net/blog/?p=3376
ページ名: