MikeBerggren.com (4.1)

  • Archive
  • RSS
  • Ask me anything

How To Quickly Verify Certificate Chain Files Using OpenSSL

I nearly forgot this command string so I thought I’d write it down for safe keeping.

Occasionally it’s helpful to quickly verify if a given root cert, intermediate cert(s), and CA-signed cert match to form a complete SSL chain.  

There are a number of tools to check this AFTER the cert is in production (e.g. curl, openssl s_client, etc) but sometimes it’s helpful to check before doing that.  This is especially true nowadays considering how many different intermediates and roots there are.  For this type of scenario, you can openssl:

openssl verify -verbose -purpose sslserver -CAfile <file containing both root and intermediates> <file containing signed cert> 

If successful, you’ll get back a response like <cert name>: OK

If unsuccessful (or something is missing), you’ll get back a response like:

Error 20 at 0 depth lookup: unable to get local issuer certificate

The error and depth levels can change but you get the idea.  Fun stuff.

    • #openssl
    • #ssl
    • #certificates
    • #how-to
    • #technology
  • 9 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Recent comments

Blog comments powered by Disqus
← Previous • Next →

About

Technology Enthusiast, Aspiring Musician, Avid Gamer, Comic Book Fan, and Sci-Fi Addict.

My opinions are my own.

Pages

  • 2013 Burger List
  • 2013 Resolutions
  • Board Games
  • Books
  • Code
  • Command Directory
  • Deckbox
  • Downloads
  • Img
  • Tea Reviews

Me, Elsewhere

  • @mikeberggren on Twitter
  • mikeberggren on Flickr
  • mikeberggren on Last.fm
  • mikeberggren on Soundcloud
  • mikeberggren on Rdio
  • mikeberggren on Foursquare
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union