Certificate Issues
Certificate Issues
Section titled “Certificate Issues”This guide covers common TLS certificate problems in Mantis deployments. Mantis uses mTLS (mutual TLS) for internal communication between Mandible, Thorax, and Tarsus, so certificate misconfiguration is one of the most common sources of connectivity failures.
Symptoms
Section titled “Symptoms”| Symptom | Likely Cause |
|---|---|
| Tarsus fails to register | CA certificate mismatch or expired cert |
| gRPC health shows “unhealthy” | Thorax mTLS handshake failing |
certificate verify failed in logs | CA not trusted or cert chain incomplete |
certificate has expired | Certificate past its validity period |
bad certificate | Client cert not signed by expected CA |
Certificate Expiry
Section titled “Certificate Expiry”Check Certificate Expiry
Section titled “Check Certificate Expiry”# Check a PEM certificate fileopenssl x509 -in /etc/mantis/certs/server.crt -noout -enddate
# Check a remote server's certificateopenssl s_client -connect mantis.example.com:3000 < /dev/null 2>/dev/null \ | openssl x509 -noout -enddate
# Check all certificates in a directoryfor cert in /etc/mantis/certs/*.crt; do echo "$cert: $(openssl x509 -in "$cert" -noout -enddate)"doneRenew Certificates
Section titled “Renew Certificates”If certificates have expired or are approaching expiry:
- Generate new certificates using your CA or
mantisctl - Replace certificate files on all affected components
- Restart the affected services
# Restart after certificate replacementsystemctl restart mantis-mandible mantis-thorax mantis-tarsusCA Trust Issues
Section titled “CA Trust Issues”Verify CA Chain
Section titled “Verify CA Chain”Ensure the certificate was signed by the expected CA:
# Verify certificate against CAopenssl verify -CAfile /etc/mantis/certs/ca.crt /etc/mantis/certs/server.crt
# Check the full chainopenssl verify -CAfile /etc/mantis/certs/ca.crt \ -untrusted /etc/mantis/certs/intermediate.crt \ /etc/mantis/certs/server.crtCommon CA Problems
Section titled “Common CA Problems”Problem: unable to get local issuer certificate
The server certificate was signed by a CA that the client does not trust. Ensure all components reference the same CA certificate file.
# Each component's TLS config must reference the CA[tls]ca_cert_path = "/etc/mantis/certs/ca.crt"cert_path = "/etc/mantis/certs/component.crt"key_path = "/etc/mantis/certs/component.key"Problem: self-signed certificate in certificate chain
If using self-signed certificates, the CA certificate must be explicitly trusted by every component. The system trust store is not used for mTLS verification.
mTLS Handshake Failures
Section titled “mTLS Handshake Failures”Diagnose Handshake Issues
Section titled “Diagnose Handshake Issues”# Test mTLS connection to Mandible's internal gRPC portopenssl s_client \ -connect localhost:50052 \ -cert /etc/mantis/certs/thorax.crt \ -key /etc/mantis/certs/thorax.key \ -CAfile /etc/mantis/certs/ca.crt
# Check for TLS version compatibilityopenssl s_client -connect localhost:3000 -tls1_3Common mTLS Problems
Section titled “Common mTLS Problems”Problem: no suitable certificate found
The client is not presenting a certificate. Verify the component’s TLS configuration includes both cert_path and key_path.
Problem: certificate required
The server requires a client certificate but none was provided. This is expected behavior — all internal Mantis communication requires mTLS.
Problem: wrong CN (Common Name)
Mantis extracts the service identity from the certificate’s Common Name. For Tarsus agent certificates, the CN is a free-form name matching the client_name used during registration — there is no fixed value required. The only reserved system CN is mandible, which is used exclusively by Mandible’s internal dispatch certificate. When Thorax connects to Mandible it presents the certificate configured at [mandible].tls_cert_path as its client identity — provisioned separately from the Thorax server certificate.
Certificate File Permissions
Section titled “Certificate File Permissions”Ensure certificate files have correct permissions:
# Private keys should only be readable by the service userchmod 600 /etc/mantis/certs/*.keychown mantis:mantis /etc/mantis/certs/*.key
# Certificates and CA can be world-readablechmod 644 /etc/mantis/certs/*.crt
# Verify permissionsls -la /etc/mantis/certs/Certificate Revocation
Section titled “Certificate Revocation”If a certificate has been compromised, revoke it through the Lens UI or API:
# Check if a registration (and its certificate) is revokedcurl -s -H "Authorization: Bearer $TOKEN" \ https://mantis.example.com/api/v1/registrations/{id} | jq '.status'# A revoked registration will show "revoked" as the status value
# Revoke a registration via the APIcurl -s -X POST -H "Authorization: Bearer $TOKEN" \ https://mantis.example.com/api/v1/registrations/{id}/revokeRevoked certificates are rejected at the application layer: Thorax checks with Mandible on each gRPC request whether the client certificate has been revoked (results are cached for up to 60 seconds). If the certificate is revoked, Thorax returns a gRPC UNAUTHENTICATED error on that request — the TLS connection itself is not closed, but every subsequent call is rejected too once the cache reflects the revocation. After revocation, the affected component must be re-enrolled with a new certificate.
Debugging Checklist
Section titled “Debugging Checklist”- Check certificate expiry dates
- Verify the CA chain (
openssl verify) - Confirm file permissions on private keys
- Ensure all components reference the same CA certificate
- Check the certificate CN matches the expected identity
- Review component logs for specific TLS error messages
- Test connectivity with
openssl s_client
Next Steps
Section titled “Next Steps”- Connection Problems — Broader connectivity troubleshooting
- Certificate Backup — Protect your certificates
- Key Rotation Runbook — Scheduled certificate rotation
