Assuming your certificates are in PEM format, you can do:

openssl verify cert.pem

If your "ca-bundle" is a file containing additional intermediate certificates in PEM format:

openssl verify -untrusted ca-bundle cert.pem

If your openssl isn't set up to automatically use an installed set of root certificates (e.g. in /etc/ssl/certs), then you can use -CApath or -CAfile to specify the CA.

Answer from Andy on Stack Exchange
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › how-to-check-tls-ssl-certificate-expiration-date-from-linux-cli
How to check TLS/SSL certificate expiration date from Linux CLI? - GeeksforGeeks
July 23, 2025 - Step 2: Define the variable for the site URL or the site name that you want to view the expiration date of TLS/SSL. (for eg. google.com). Use the below code to define a variable in CLI. (Replace google.com with the URL of the site that you want to see.) ... Enter the above command and press enter. Step 3: Again define one variable for the Port address as shown below. ... Step 4: Now use the below command to view the Expiration date, Paste the below command in CLI and press enter.
Discussions

SSL Cert Location
Hello Team , like to know where to slick the SSL cert in the rocky Linux 9 OS and update it. More on forums.rockylinux.org
🌐 forums.rockylinux.org
0
July 3, 2023
linux - Using openssl to get the certificate from a server - Stack Overflow
I am trying to get the certificate of a remote server, which I can then use to add to my keystore and use within my Java application. A senior dev (who is on holidays :( ) informed me I can run this: More on stackoverflow.com
🌐 stackoverflow.com
Ever Struggled with SSL/TLS Certificate Chains? Check This Out!
https://whatsmychaincert.com/ :) More on reddit.com
🌐 r/linuxadmin
9
64
May 28, 2024
How do I know if my installed SSL certificates are authentic?
Doubtful, but possible. Is your router secure? For that matter is your computer secure? Have you installed any software as root from unknown "weird" sites? My grandma gave me the best Linux advice ever by saying "if it smells bad, throw it out." If you really feel that you have been breached, then back up your files and do a clean install. Threat adversaries can come at you for a lot of different reasons, and I respect your better judgement. More on reddit.com
🌐 r/linuxquestions
6
4
July 31, 2024
🌐
Acquia
docs.acquia.com › acquia-cloud-platform › help › 93661-verifying-validity-ssl-certificate
Verifying the validity of an SSL certificate
Check to see if your Private Key is in PEM format: ... openssl x509 -noout -modulus -in certificate.pem | openssl md5 openssl rsa -noout -modulus -in ssl.key | openssl md5
🌐
SSL Dragon
ssldragon.com › home › blog › advanced ssl › how to check an ssl certificate in linux with openssl
How to Check an SSL Certificate in Linux with OpenSSL
October 27, 2025 - You can check your OpenSSL version by running the following command: ... Certificate files in Linux are located by default in the /etc/pki/tls/certs folder or sometimes within an application-specific folder such as /etc/httpd for Apache.
🌐
TechRepublic
techrepublic.com › home › how to utilize openssl in linux to check ssl certificate details
How to utilize openssl in Linux to check SSL certificate details - TechRepublic
November 1, 2022 - This script below can also be used to extrapolate even more details about a certificate and as above can be used locally or remotely. I call it ssl_validate.sh, but you can copy the contents into a new script file with whatever name you like, use chmod +x to make it executable, and then use it with the following syntax: ./ssl_validate.sh (or whichever script name you choose) server.company.com:443, where “server.company.com” is the fully qualified domain name (FQDN) of the host you wish to check and 443 is the port it’s listening on associated with the SSL certificate.
🌐
DigiCert
digicert.com › help
SSL Certificate Checker - Diagnostic Tool | DigiCert.com
Our installation diagnostics tool will help you locate the problem and verify your SSL Certificate installation. Server Address: (Ex. www.digicert.com) Checking...
Find elsewhere
🌐
ttias.be
ma.ttias.be › how-to-read-ssl-certificate-info-from-the-cli
How To Read The SSL Certificate Info From the CLI
August 10, 2015 - Here’s what it looks like for my own certificate. $ openssl x509 -text -noout -in certificate.crt Certificate: ...
🌐
www.kaper.com
kaper.com › notes › check-ssl-certificate-expire-from-command-line
Check SSL Certificate Expire From Command Line – www.kaper.com
If you want to check SSL Certificate expires from the Linux command line, you can do that like this: echo | openssl s_client -showcerts -servername www.kaper.com -connect www.kaper.com:443 | openssl x509 -noout -datesCode language: Bash (bash) (Of course replace the www.kaper.com by the host ...
🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
SSL Cert Location - Rocky Linux Help & Support - Rocky Linux Forum
July 3, 2023 - Hello Team , like to know where to slick the SSL cert in the rocky Linux 9 OS and update it.
🌐
Quora
quora.com › How-do-I-view-certificates-in-Linux
How to view certificates in Linux - Quora
They’re what stump my students who are trying for the bonus points for ‘setting up and securing a server’. They’re not kept in the same place in every Linux flavor. In Red Hat or CentOS they’re in /etc/pki/tls/certs.
🌐
GitHub
gist.github.com › stonehippo › 710faa4b307a223e469e84b2ae3db340
A couple of ways to look at web server HTTPS/TLS/SSL certificate data via the command line · GitHub
I recently wanted to change the configuration on an application server, moving the TLS termination from a Tomcat server to NGINX proxy. I needed to extract the certificate and private key from the original PKCS12 store. Here's how I did that: openssl pkcs12 -in ./[pkcs12 file] -clcerts -nokeys -out public.crt openssl pkcs12 -in ./[pkcs12 files] -nocerts -nodes -out private.rsa
🌐
Keyfactor
keyfactor.com › home › how to check ssl certificates and stay secure
How to Check SSL Certificates and Stay Secure | Keyfactor
1 week ago - If you use NGINX (common on many Linux distributions for performance reasons), the process differs slightly. NGINX requires the certificate and the chain to be combined in one file: ... Once the server is restarted, test your SSL installation by visiting your site in multiple browsers and checking for the HTTPS padlock icon.
🌐
curl
curl.se › docs › sslcerts.html
curl - SSL CA Certificates
We strongly recommend this is avoided ... in production. Get a CA certificate that can verify the remote server and use the proper option to point out this CA cert for verification when connecting - for this specific transfer only. ... If you use the curl command line tool without a native CA store, then you can specify your own CA cert file by setting the environment variable CURL_CA_BUNDLE to the path of your choice. SSL_CERT_FILE ...
🌐
Baeldung
baeldung.com › home › web › validating certificates using curl
Validating Certificates Using cURL | Baeldung on Linux
March 18, 2024 - We should as well do revocation checks against every intermediate and check the certificate’s fingerprint against the explicit blacklists that Mozilla/Apple/Google/Microsoft maintain. curl performs peer SSL certificate validation by default. This is done using a certificate store that the SSL library can use to ...
🌐
SSLInsights
sslinsights.com › home › wiki › how to check ssl certificate expiration date in linux
How to Check SSL Certificate Expiration Date in Linux
May 13, 2025 - Also Read: How to Check SSL Certificate Expiration Date Using OpenSSL ... for domain in google.com github.com example.com; do echo -n "$domain: " echo | openssl s_client -connect $domain:443 2>/dev/null | openssl x509 -noout -enddate done · Monitoring SSL certificate expiration dates in Linux is crucial for maintaining secure, uninterrupted web services.
Address   1207 Delaware Ave #2838, 19806, Wilmington
(5.0)
🌐
nixCraft
cyberciti.biz › nixcraft › howto › bash shell › how to check tls/ssl certificate expiration date from command-line
How to check TLS/SSL certificate expiration date from Linux CLI - nixCraft
April 16, 2025 - Download the script using the wget ... $ testssl.sh --fast --parallel https://www.cyberciti.biz/ Another option is to run ssl-cert-check script, which is a Bourne shell script that can be used to report on expiring SSL ...