nats-io/nats-server · error
%s peer missing TLS verified chains
Error message
%s peer missing TLS verified chains
What it means
Peer-verification callback: the TLS connection state has no VerifiedChains, meaning the peer's certificate chain was not verified against the trusted CA — without a verified chain the OCSP staple cannot be matched to an issuer, so the handshake is rejected.
Source
Thrown at server/ocsp.go:494
PrivateKey: ccert.PrivateKey,
SupportedSignatureAlgorithms: ccert.SupportedSignatureAlgorithms,
SignedCertificateTimestamps: ccert.SignedCertificateTimestamps,
Leaf: ccert.Leaf,
}, nil
}
// Check whether need to verify staples from a peer router or gateway connection.
switch kind {
case kindStringMap[ROUTER], kindStringMap[GATEWAY]:
tc.VerifyConnection = func(s tls.ConnectionState) error {
oresp := s.OCSPResponse
if oresp == nil {
return fmt.Errorf("%s peer missing OCSP Staple", kind)
}
// Peer connections will verify the response of the staple.
if len(s.VerifiedChains) == 0 {
return fmt.Errorf("%s peer missing TLS verified chains", kind)
}
chain := s.VerifiedChains[0]
peerLeaf := chain[0]
peerIssuer := certidp.GetLeafIssuerCert(chain, 0)
if peerIssuer == nil {
return fmt.Errorf("failed to get issuer certificate for %s peer", kind)
}
// Response signature of issuer or issuer delegate is checked in the library parse
resp, err := ocsp.ParseResponseForCert(oresp, peerLeaf, peerIssuer)
if err != nil {
return fmt.Errorf("failed to parse OCSP response from %s peer: %w", kind, err)
}
// If signer was issuer delegate double-check issuer delegate authorization
if resp.Certificate != nil {
ok := falseView on GitHub (pinned to 3a66a489d2)
Solutions
- Ensure the peer certificate is signed by a CA the server trusts
- Fix the peer's chain so it sends intermediates
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/ocsp.go:494 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- SSL/TLS and certificate errors — how TLS handshakes and certificate validation fail.
AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02).
Data as JSON: /api/errors/81b805da2dbd9929.
Report an issue: GitHub.