인증서는 보통 1년 또는 2년짜리로 발급받으며, 제때에 인증서를 업데이트 하지 않으면 사용자에 불편을 초래할 수 있다.

SSL 인증서 만료기간을 확인하는 방법은 아래와 같다.

1. 브라우저 주소창에서 인증서 확인하기

브라우저 주소 입력창에서 https:// 로 호출 한 후, "자물쇠" 모양을 클릭하면 인증서 기간(시작일자 - 만료일자)을 확인할 수 있다.

2. openssl 명령어로 cert 파일 해독하기

* 명령어
$ openssl x509 -in [SSL 인증서 경로]/[cert 파일명] -noout -dates

* 예시)

$ openssl x509 -in /data/www_sample.crt -noout -dates

notBefore=May 2 09:10:11 2020 GMT
notAfter=May 1 09:10:11 2021 GMT

3. openssl 명령어로 원격에 설치되어 있는 인증서 만료일 확인

* 명령어
$ echo | openssl s_client -servername [서버/DNS] -connect [서버/DNS:포트] 2>/dev/null | openssl x509 -noout -dates

* 예시)

$ echo | openssl s_client -servername www.sample.co.kr -connect www.sample.co.kr:443 2>/dev/null | openssl x509 -noout -dates
또는
$ echo | openssl s_client -servername 10.x.x.x -connect 10.x.x.x:443 2>/dev/null | openssl x509 -noout -dates

notBefore=May 2 09:10:11 2020 GMT
notAfter=May 1 09:10:11 2021 GMT