Skip to content

[release-1.18] Increase maximum PEM sizes for leaf certificates and chains#7966

Merged
cert-manager-prow[bot] merged 1 commit intocert-manager:release-1.18from
cert-manager-bot:cherry-pick-7961-to-release-1.18
Aug 15, 2025
Merged

[release-1.18] Increase maximum PEM sizes for leaf certificates and chains#7966
cert-manager-prow[bot] merged 1 commit intocert-manager:release-1.18from
cert-manager-bot:cherry-pick-7961-to-release-1.18

Conversation

@cert-manager-bot
Copy link
Copy Markdown
Contributor

This is an automated cherry-pick of #7961

/assign SgtCoDFish

Increase maximum sizes of PEM certificates and chains which can be parsed in cert-manager, to handle leaf certificates with large numbers of DNS names or other identities

We've seen in cert-manager#7506 that the PEM size maxima we have can be too
restrictive for some users who have large numbers of DNS identities in
their leaf certificates, preventing them from using cert-manager for
those certificates (or stopping them from upgrading).

This change adds a large estimate for extra data which might be present
in a leaf certificate, based on an experimentally observed increase in
the size of a certificate request object by adding new DNS names.

We assume 250 large DNS names, totalling about 30kB of size.

We shouldn't expect to see a performance change in our existing
benchmark with these changes, because the maxBundleSize is used for
those tests and that size remains larger than the new
maxCertificateChainSize. That seems to be the case from testing:

```console
$ go test -bench=. ./internal/pem/...
goos: darwin
goarch: arm64
pkg: github.com/cert-manager/cert-manager/internal/pem
cpu: Apple M3 Max
BenchmarkPathologicalInput-16                 52          22606764 ns/op
PASS
ok      github.com/cert-manager/cert-manager/internal/pem       2.485s

$ go test -bench=. ./internal/pem/...
goos: darwin
goarch: arm64
pkg: github.com/cert-manager/cert-manager/internal/pem
cpu: Apple M3 Max
BenchmarkPathologicalInput-16                 52          22455893 ns/op
PASS
ok      github.com/cert-manager/cert-manager/internal/pem       2.408s
```

Signed-off-by: Ashley Davis <ashley.davis@cyberark.com>
@cert-manager-prow cert-manager-prow bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 15, 2025
@cert-manager-prow cert-manager-prow bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 15, 2025
Copy link
Copy Markdown
Member

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
/kind bug

Simple cherry-pick

@cert-manager-prow cert-manager-prow bot added kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Aug 15, 2025
@cert-manager-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SgtCoDFish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 15, 2025
@cert-manager-prow cert-manager-prow bot merged commit dfa2d9e into cert-manager:release-1.18 Aug 15, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants