Testing and Verification

Commands and procedures for testing and verifying TLS configurations on Bindplane collectors.

Testing TLS Connections with OpenSSL

OpenSSL's s_client tool is the standard for testing TLS connections. It allows you to inspect certificates, test handshakes, and debug TLS issues.

Basic Connectivity Test

Test that the TLS server is accepting connections:

openssl s_client -connect collector.example.com:10514

What to look for:

  • CONNECTED - TCP connection established

  • Certificate chain displayed

  • Verify return code: 0 (ok) - Certificate verified successfully

  • Or appropriate verification result based on your setup

To exit: Type CTRL-C or Q then ENTER

View Certificate Chain

See the complete certificate chain sent by the server:

openssl s_client -connect collector.example.com:10514 -showcerts

What this shows:

  • All certificates in the chain (server cert + intermediates)

  • Full PEM-encoded certificates

  • Certificate details for each cert in the chain

Useful for:

  • Verifying the server sends intermediate certificates

  • Checking certificate order

  • Debugging "Unknown CA" errors

Test Specific TLS Version

Test connectivity with a specific TLS version:

Expected results:

  • Connection succeeds if version is supported

  • Connection fails if version is not supported (below min_version or above max_version)

Test Cipher Suites

Test a specific cipher suite:

List supported cipher suites:

OpenSSL s_client Options Reference

Option
Description

-connect <host>:<port>

Server to connect to

-showcerts

Show all certificates in the chain

-CAfile <file>

CA certificate file for verification

-cert <file>

Client certificate file (for mTLS)

-key <file>

Client private key file (for mTLS)

-tls1_2

Use only TLS 1.2

-tls1_3

Use only TLS 1.3

-cipher <list>

Specify cipher suites to use

-servername <name>

Set SNI (Server Name Indication) hostname

-debug

Print debug information

-state

Print TLS session states

For complete OpenSSL s_client documentation, see: https://www.openssl.org/docs/man1.1.1/man1/s_client.html

Verifying Certificate and Key Match

It's critical to verify that your certificate and private key are a matching pair before deploying them.

This method extracts the public key from both files and compares them directly:

Interpretation:

  • No output from diff = Files match

  • Identical hashes = Files match

  • Any difference = Files do NOT match

Method 2: Compare Modulus Hashes

This method compares the modulus values from both files:

Example output:

circle-check

Certificate Inspection

View Certificate Details

Inspect all information in a certificate:

Key information shown:

  • Subject (who the certificate identifies)

  • Issuer (who signed the certificate)

  • Validity period (not before / not after dates)

  • Public key algorithm and size

  • Subject Alternative Names (SANs)

  • Key usage and extended key usage

  • Signature algorithm

Check Expiration Date

Quickly check when a certificate expires:

Example output:

Check both start and end dates:

View Subject and Issuer

See who the certificate identifies and who issued it:

Example output:

View Subject Alternative Names (SANs)

See all hostnames/IPs the certificate is valid for:

Example output:

Check Certificate Chain Order

When you have a chain file, verify the order:

Expected order:

  1. First certificate: Server/leaf (subject = your server)

  2. Second certificate: Intermediate CA (subject = intermediate, issuer = root or another intermediate)

  3. Third certificate (optional): Root CA (subject = issuer = root CA)

Testing Mutual TLS (mTLS)

Test with Client Certificate

Test mTLS connection with a client certificate:

What to look for:

  • CONNECTED - Connection established

  • Verify return code: 0 (ok) - Server certificate verified

  • Client certificate sent (shown in output)

  • Connection successful

Verify Unauthorized Clients Are Rejected

When using client_ca_file, test that connections without client certificates fail:

Expected result:

  • Connection rejected during handshake

  • Error: certificate required or handshake failure

  • Exit code: non-zero

Debug Client Certificate Issues

Get detailed information about client certificate verification:

Options:

  • -state: Shows TLS protocol state transitions

  • -debug: Shows detailed protocol messages

Verify Client Certificate Against CA

Check that a client certificate is properly signed by the CA:

Expected output:

If verification fails:

  • unable to get issuer certificate - CA file doesn't contain the issuer

  • certificate has expired - Client certificate is expired

  • unable to get local issuer certificate - Missing intermediate CA

Platform-Specific Commands

Check Certificate Format

View First Few Lines

Calculate File Hashes

Test OpenSSL Installation

Automated Testing

Health Check Script

Create a simple health check script to verify TLS connectivity:

Usage:

Certificate Expiration Monitoring

Monitor certificate expiration dates:

Integration Testing

Test the full pipeline with sample data:

Continuous Monitoring

Certificate Renewal Checks

Set up periodic checks for certificate renewal:

TLS Endpoint Monitoring

Use tools like:

  • Nagios/Icinga: Check certificate expiration and validity

  • Prometheus: blackbox_exporter for TLS monitoring

  • Datadog/New Relic: Synthetic monitoring for TLS endpoints

Example Prometheus blackbox_exporter config:

Common Verification Scenarios

Verify Certificate Chain is Complete

Verify Certificate Matches Domain

Verify Private Key is Unencrypted

Verify File Permissions

Last updated

Was this helpful?