Repository navigation
Conversation
exportCerts.php appended the stored private key to every exported item, including CAs referenced as client-certificate CA (ca-file) and backend CA. HAProxy only needs the CA certificates there, so the CA's private key ended up in /tmp/haproxy/ssl/*.calist for no reason. Only append the private key for certificates. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important notices
Before you submit a pull request, we ask you kindly to acknowledge the following:
If AI was used, please disclose:
Describe the problem
exportCerts.phpbuilds every exported item as certificate + stored private key, regardless of the item type. For a CA that has its private key stored in the trust store (e.g. an internal CA created on OPNsense to issue client certificates), the CA's private key is therefore written into the CA list file/tmp/haproxy/ssl/<id>.calist. That file is used asca-filefor client certificate verification on a public service, and asca-filefor backend server verification.HAProxy only needs the CA certificates in a
ca-file; the private key is never used there. Having it exported means an extra plaintext copy of the CA signing key on disk, which is enough to mint client certificates the frontend would accept.Steps to reproduce:
grep -c 'PRIVATE KEY' /tmp/haproxy/ssl/*.calistreturns 2 (BEGIN/END lines of the CA key).Describe the proposed solution
Only append the private key when exporting items of type
cert. CA (and CRL, which already had its own branch) exports then contain just the certificate data plus the linked CA chain, as before.Tested on OPNsense 26.7.7 with os-haproxy 5.1 (the patched file is identical to current master apart from this change):
.calistcontains only the CA certificate, no private key; the server.pemfiles still contain their key.Related issue
None.
🤖 Generated with Claude Code