Skip to content

Feat/cacerts - #619

Merged
lhotari merged 27 commits into
apache:masterfrom
gulecroc:feat/cacerts
Jun 21, 2025
Merged

lhotari merged 27 commits into
apache:masterfrom
gulecroc:feat/cacerts

Conversation

@gulecroc

Copy link
Copy Markdown
Contributor

Fixes #598

Motivation

Create a combined PEM for CA certificates from values :

tls:
  <component>:
    cacerts:
      enabled: true/false
      certs:
        - name: cacert
          existingSecret: cacert-secret
          secretKeys:
            - ca.crt

Modifications

If tls.<component>.cacerts.enabled: true :

  • mount an emptyDir <component>-cacerts to /pulsar/certs/cacerts
  • mount certs-combine-pem.sh and certs-combine-pem-inifinity.sh to /pulsar/bin
  • mount each certificate tls.<component>.cacerts.certs.<cert> to /pulsar/certs/<cert>
  • add an initContainer to create the initial /pulsar/certs/cacerts/ca-combined.pem file
  • run certs-combine-pem-inifinity.sh as background process to check every minute

Verifying this change

  • [ X ] Make sure that the change passes the CI checks.

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great work @gulecroc

@lhotari

lhotari commented Jun 21, 2025

Copy link
Copy Markdown
Member

One small detail. I ran a check to see how the files are combined and asked Claude AI if this is a valid combined PEM file.

pulsar-ci-broker-0:/pulsar/certs/cacerts$ cat ca-combined.pem
# /pulsar/certs/ca/ca.crt
-----BEGIN CERTIFICATE-----
MIIDMTCCAhmgAwIBAgIQe5i0wZReFkm0DZvYLNYn0zANBgkqhkiG9w0BAQsFADAj
MSEwHwYDVQQDExhwdWxzYXIuc3ZjLmNsdXN0ZXIubG9jYWwwHhcNMjUwNjIxMTk1
ODI1WhcNMjUwOTE5MTk1ODI1WjAjMSEwHwYDVQQDExhwdWxzYXIuc3ZjLmNsdXN0
ZXIubG9jYWwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDhX+TQWt24
ITJeI/xuSB3R4hrhNFTK7g6/Al5mkXmT5UdwiwVy3C1foCcWT3qSLKpsSu8BN2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BAQDKsx+KZbE/NXN4RpmZJfbo6boh/cIKPfjs4sCB
MHt9ps0bXAig7E5kFlQdqFxhyI5gopo/NDOFjt7uI6SH8mrL7cCcQKO5ULaztQuR
FzT+PmE/dmpwo/5jtFi1XipOE6o8LI9ZLAJz2NtvYV+G13U6plhgBuGamu651R7/
SjMjMiomZjeA6BINSlOpaiU05BsW6pNnV+RfdlW5np095mYKjuy4G26v5VGwFywd
K8/MGIwjtIxlNc9lz9R2HLDwhh0vbkn1CrDBzlUfOp+jhDMi+ogQrPfFkoASrWmR
QeXYPbxfQddYTo5U7FvK1I10JE4F+wTBsfQ+aj89EIdcJeC3AgMBAAGjYTBfMA4G
A1UdDwEB/wQEAwICBDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDwYD
VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU9OT7ttVeGlX1p9Wt1gso0+EK5N4wDQYJ
KoZIhvcNAQELBQADggEBAJbvH75BQLKAqe41onEqyWdZ61xbX9aV60jYnBHmffF8
vXHNwsSZipuLhe85StgpHCJYBeK2UBh4of3M/inkqS4OU9vdOoJ/jOi9KjCLSezt
UBEbSMKunjKEJhdgszT7C1ESlk115DLXYeQwDMdDAR5SNyOHGJQsMcBLcdtI5/wq
Dl02oowhMPFMg0NmsurQj2j9PRP7fNl1CU3RiOc6oB4oy6LESz47J5aa3Mpe+Uzy
iVZWuZWSpk7IU6ieoci+JBssjiNkVjydjmgH8122Co7GFLucSghWFkU85F14Rfo1
4qDr/M9VPzU7rcoLi7wenCGo1B9d2GWvNb3Z/Bvhl30=
-----END CERTIFICATE-----

The response was:

Comments are generally not valid in standard PEM files according to RFC specifications. However, many tools and applications will tolerate them in practice.
RFC 7468 (the PEM format specification) does not define comment syntax
Standard PEM parsers expect only the -----BEGIN/END----- blocks and base64-encoded content
Lines starting with # are technically non-compliant

@lhotari

lhotari commented Jun 21, 2025

Copy link
Copy Markdown
Member

The response was:

Comments are generally not valid in standard PEM files according to RFC specifications. However, many tools and applications will tolerate them in practice.
RFC 7468 (the PEM format specification) does not define comment syntax
Standard PEM parsers expect only the -----BEGIN/END----- blocks and base64-encoded content
Lines starting with # are technically non-compliant

This isn't a correct response from the LLM. I checked https://www.rfc-editor.org/rfc/rfc7468.html and it says:
"Data before the encapsulation boundaries are permitted, and parsers MUST NOT malfunction when processing such data."
So this means that the comments are fine.

@lhotari
lhotari merged commit e8ab0c6 into apache:master Jun 21, 2025
@gulecroc

Copy link
Copy Markdown
Contributor Author

Thank you @lhotari for your quick review !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more certificates to the truststore

2 participants