OpenSSL

# check local certificate
openssl x509 -text -in /etc/ssl/certs/example.com.pem

# check remote certificate
openssl s_client -connect example.com:443 | openssl x509 -text -noout