Connect: Non-blocking query to Leaf Cert endpoint can return an expired certificate #9862
Labels
theme/certificates
Related to creating, distributing, and rotating certificates in Consul
theme/connect
Anything related to Consul Connect, Service Mesh, Side Car Proxies
type/bug
Feature does not function as expected
type/docs
Documentation needs to be created/updated/clarified
Overview of the Issue
When using non-blocking queries on the /agent/connect/ca/leaf/:service endpoint, Consul can return an out of date certificate. This directly contradicts the docs at https://www.consul.io/api-docs/agent/connect#service-leaf-certificate
Reproduction Steps
2 node cluster with 1 client node and 1 server node in Connect mode. Both agents running Consul 1.9.3.
Set the Connect leaf_cert_ttl to be 1h.
Get a cert for service "leaf-cert" on the client node
Wait an hour, hit the same endpoint again. The same, now out of date, certificate is returned (look at the ValidBefore field)
Presumably this is a caching issue. Using a blocking query will get an up to date cert as will subsequent non-blocking queries after the blocking query.
Consul info for both Client and Server
Client info
Server info
Log Fragments
Attached but there appears to be nothing interesting in them.
client_logs.txt
server_logs.txt
The text was updated successfully, but these errors were encountered: