How to Check a Certificate with OpenSSL - SSL Dragon (2024)

Last updated on by Dionisie Gitlan

How to Check a Certificate with OpenSSL - SSL Dragon (1)

If you manage a website or server, ensuring your SSL certificate is valid and properly configured is a top priority. One way to do this is with OpenSSL, a popular open-source cryptographic utility.

You can use OpenSSL to check the certificate expiration date, issuer, and subject. In this article, we’ll show you how to check a certificate with OpenSSL commands in Linux. Whether you are a web developer, system administrator, or just curious about SSL, this guide will provide the exact steps and command lines to check certificates with OpenSSL.

Table of Contents

  1. How to Check the OpenSSL Version?
  2. How to View the Full Certificate Details
  3. View the SSL Certificate Itself (Encoded)
  4. Check If the Key Matches the Certificate
  5. Check Who Issued the SSL Certificate
  6. Check Whom the SSL Certificate Is Issued To
  7. Check SSL Certificate Validity in Linux
  8. Display All the Above Info About the SSL Certificate

How to Check the OpenSSL Version?

Most Linux systems will have OpenSSL pre-installed, but it’s better to ensure you have the latest running version. You can check your OpenSSL version by running the following command:

openssl version –a

How to Check a Certificate with OpenSSL - SSL Dragon (2)

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. These generally use .pem or .crt extensions and will likely be named yourdomain.pem or yourdomain.crt, but sometimes the generic “server” file name is used as well.

If you’ve applied for the SSL certificate and installed it on the server, you should already know its location and file names.

How to View the Full Certificate Details

You can use OpenSSL to check certificate validity, issuer, and subject separately or in one go. Ensure you have access to your server and SSH terminal.

OpenSSL provides a rich variety of commands to generate, install, and manage certificates. To check the details of a particular certificate, run the following command:

openssl x509 -in /root/mycertificate.crt -text -noout

Use this OpenSSL command to check certificate expiry, subject, issuer, key details, and signature algorithm. Here’s what you should see:

How to Check a Certificate with OpenSSL - SSL Dragon (3)

View the SSL Certificate Itself (Encoded)

OpenSSL allows you to view the SSL certificate in its original encoded format. Run the command below to display it:

$ echo | openssl s_client -servername howtouselinux.com -connect yourplc.com:443 2>/dev/null | openssl x509

How to Check a Certificate with OpenSSL - SSL Dragon (4)

Check If the Key Matches the Certificate

To verify if the public and private keys match, you need to extract the public key from each file and generate a hash output for it. All three files should share the same public key and the same hash value. Here’s how to use OpenSSL to check certificates and key details. The following commands to generate a hash of each file’s public key:

openssl pkey -pubout -in privateKey.key | openssl sha256

How to Check a Certificate with OpenSSL - SSL Dragon (5)

openssl req -pubkey -in CSR.csr -noout | openssl sha256

How to Check a Certificate with OpenSSL - SSL Dragon (6)

openssl x509 -pubkey -in certificate.crt -noout | openssl sha256

How to Check a Certificate with OpenSSL - SSL Dragon (7)

Check Who Issued the SSL Certificate

If you want to check the SSL certificate issuer, run the command line below. It will show you the Certificate Authority that signed the cert.

echo | openssl s_client -servername yourplc.com -connect yourplc.com:443 2>/dev/null | openssl x509 -noout -issuer

Check Whom the SSL Certificate Is Issued To

You can also check the subject of the SSL certificate. Depending on the validation type, you will see just the common name, or also the official company’s name.

$ echo | openssl s_client -servername .com -connect howtoyourplcuselinux.com:443 2>/dev/null | openssl x509 -noout -subject

Check SSL Certificate Validity in Linux

It’s important to know when the SSL certificate expires, so you can renew it in advance and avoid potential website outages and data breaches. Here’s how to check the SSL certificate expiration date in Linux:

$ echo | openssl s_client -servername howtouselinux.com -connect yourplc.com:443 2>/dev/null | openssl x509 -noout -dates

Display All the Above Info About the SSL Certificate

You can also use an OpenSSL command to check the certificate issuer, subject, and expiration date with the following command:

$ echo | openssl s_client -servername howtouselinux.com -connect yourplc.com:443 2>/dev/null | openssl x509 -noout -issuer -subject -dates

How to Check a Certificate with OpenSSL - SSL Dragon (8)

Final Words

If something goes wrong with your SSL connection, verifying your certificate’s details is the first step toward finding the culprit. In OpenSSL, you have a great utility to perform all kinds of checks, from inspecting the certificate issuer to analyzing technical data and seeing when the certificate expires. OpenSSL integrates with Linux and provides control over SSL installation via its flexible command lines.

Save 10% on SSL Certificates when ordering today!

Fast issuance, strong encryption, 99.99% browser trust, dedicated support, and 25-day money-back guarantee. Coupon code: SAVE10

Save 10% Now!

How to Check a Certificate with OpenSSL - SSL Dragon (9)

Written by Dionisie Gitlan

Experienced content writer specializing in SSL Certificates. Transforming intricate cybersecurity topics into clear, engaging content. Contribute to improving digital security through impactful narratives.

How to Check a Certificate with OpenSSL - SSL Dragon (2024)
Top Articles
Environmental Monitoring Market Size Worth $26.7 Billion By 2025
AI Eye Podcast: AppTech Payments Corp Discusses the Importance of Fintech Patents, AI and the Future Banking Transformation - AppTech Payments (NASDAQ:APCX)
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6862

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.