• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • PKI Training
  • OpenSSL
  • Keytool
  • PKI Tools
    • Apereo CAS
    • SAML
    • OpenID Connect
  • Get expert help

Verify Certificate Chains with OpenSSL

Verifying certificate chains is one of the most common troubleshooting tasks when diagnosing TLS and SSL connection issues. If a certificate chain is incomplete or incorrectly configured, clients may fail to establish a trusted connection.

This guide explains how to verify certificate chains with OpenSSL, how certificate trust works, and how DevOps engineers can diagnose certificate validation problems.

This article is part of the PKI for DevOps Engineers training series. In previous lessons we covered certificate chains and debugging TLS with OpenSSL. In this lesson we will verify certificate chains locally using OpenSSL.

—

Table of Contents

  • What is a certificate chain
  • Why certificate chain verification fails
  • Verify certificate chains with OpenSSL
  • Common certificate verification errors
  • FAQ
—

What is a certificate chain

A certificate chain links a server certificate to a trusted root certificate authority.

The chain typically contains:

  • the server certificate
  • one or more intermediate certificates
  • a trusted root certificate

Clients verify this chain during the TLS handshake to ensure the certificate is issued by a trusted authority.

If you want a deeper explanation, see our guide on certificate chains explained.

—

Why certificate verification fails

Certificate validation errors commonly occur when:

  • intermediate certificates are missing
  • certificate chains are misconfigured
  • root certificates are not trusted
  • certificate expiration has occurred

These issues often appear as TLS handshake errors such as:

  • unable to get local issuer certificate
  • certificate verify failed
  • unable to verify the first certificate

Understanding how to validate certificate chains helps diagnose these problems quickly.

—

Verify certificate chains with OpenSSL

OpenSSL provides a command called openssl verify that can validate certificate chains locally.

Example command:

openssl verify -CAfile chain.pem server-cert.pem

In this example:

  • chain.pem contains the certificate authority chain
  • server-cert.pem is the server certificate being verified

If the certificate is valid, OpenSSL returns:

server-cert.pem: OK

If verification fails, OpenSSL will return an error describing the failure.

For a full command reference and additional examples, see our detailed guide on openssl verify.

—

Verifying certificates retrieved from servers

Before verifying a certificate locally, you may need to retrieve the certificate chain from a server.

This can be done using openssl s_client.

Example:

openssl s_client -connect example.com:443 -showcerts

This command returns the certificate chain presented by the server.

The certificates can then be saved and verified using OpenSSL.

—

Common certificate verification errors

Some common errors encountered when verifying certificate chains include:

Unable to get local issuer certificate

This usually indicates that the intermediate certificate is missing.

Certificate has expired

The certificate’s validity period has ended.

Self-signed certificate

The certificate was not issued by a trusted certificate authority.

Understanding these errors is critical when diagnosing TLS connection failures.

For more troubleshooting examples, see our guide on common TLS errors.

—

Frequently Asked Questions

What does OpenSSL verify do?

The openssl verify command validates certificate chains and confirms that a certificate is trusted by a certificate authority.

Why does certificate verification fail?

Verification commonly fails because intermediate certificates are missing or the certificate chain is misconfigured.

How can I test a server’s certificate chain?

You can retrieve the server certificate using openssl s_client and then verify the certificate locally with OpenSSL.

—

Next Lesson

Next we will learn how to create certificate signing requests using OpenSSL.

Lesson 6 – Creating CSRs with OpenSSL →

—

Training Series Navigation

  • PKI for DevOps Training Hub
  • Lesson 1 – TLS and PKI Basics
  • Lesson 2 – X.509 Certificates
  • Lesson 3 – Certificate Chains
  • Lesson 4 – Debug TLS
  • Lesson 5 – Verify Certificate Chains
  • Lesson 6 – Create CSR

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

PKI for DevOps Engineers – Free Training Series

PKI for DevOps Training Hub

Lesson 1 – How TLS and PKI Work

Lesson 2 – Understanding X.509 Certificates

Lesson 3 – Certificate Chains Explained

Lesson 4 – Debug TLS with OpenSSL

Lesson 5 – Verify Certificate Chains

Lesson 6 – Creating CSRs with OpenSSL

Lesson 7 – Working with PKCS12 Certificates

Lesson 8 – Java Keystores and keytool

Lesson 9 – Certificate Expiration Monitoring

Lesson 10 – Automating Certificate Renewal

Lesson 11 – Common TLS Errors

Lesson 12 – PKI Architecture for DevOps

Recent Posts

  • Apache mod_auth_cas: Protect Web Applications with Apereo CAS and Docker
  • Apache mod_auth_mellon: Configure SAML SSO & Docker
  • Configure OpenID Connect (OIDC) in Apereo CAS 7.3 and 8
  • Certificate Ownership Is an Operating Model Problem, Not a Tooling Problem
  • OpenSSL dgst: Create Checksums and Verify Digital Signatures

Footer

  • Twitter
  • YouTube
Mister PKI

Practical security engineering for the systems that establish trust.

Learn OpenSSL Keytool Free training
Work together PKI consulting CAS consulting Sponsored contributions
Site About Support Mister PKI Cookie policy Search
© 2026 Mister PKI Secure systems. Clear guidance.