Typically the SSL certificates that you would be interested in are located in the following place on the server. You would replace EXAMPLEDOMAIN.TLD with your own domain:
You'll notice that if you try to view this file with cat or less, it is not in a human readable format. You may use the following process to view the domains and validity dates of an SSL certificate file via SSH or Terminal.
- Login to the server via SSH or Terminal as the root user
- Set a variable that contains the path to the certificate that you are interested in reading. Be sure to replace EXAMPLEDOMAIN.TLD with your domain:
- Copy and paste the following command into the command line:
openssl x509 -in $CERT -text -noout | sed -n -e '/Validity/,+2p;/DNS/s/\(^ \+\)\( DNS.*\)/\2/p;' | tr ',' '\n'
- The output will look similar to the following:
Not Before: Jan 27 20:00:13 2021 GMT
Not After : Jan 27 20:00:13 2022 GMT
NOTE: You may view the full details of the certificate by using the following command instead:
openssl x509 -in $CERT -text -noout