opensslを使って、SSLサーバー証明書のドメインと有効期限を確認する

いつも忘れちゃうので備忘録。


openssl x509 -noout -subject -issuer -dates -in SSLサーバー証明書のファイル


[サンプル]
$ openssl x509 -noout -subject -issuer -dates -in SSLサーバー証明書のファイル.crt
subject= /C=JP/ST=Tokyo/L=xxx-ku/O=Kaisya Mei/OU=Busyo Mei/CN=xxx.yourdomain.com
issuer= /C=JP/O=Cybertrust Japan Co., Ltd./CN=Cybertrust Japan Public CA G3
notBefore=Nov 1 01:10:01 2013 GMT
notAfter=Feb 1 14:59:00 2015 GMT
$

[openssl x509 args 抜粋]
//snip
 -noout          - no certificate output(鍵を表示しない)
 -subject        - print subject DN
 -issuer         - print issuer DN
 -dates          - both Before and After dates
//snip
$