Skip to content

ca: allow the promotion of first domain/IP to CN in profile #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vancluever
Copy link

@vancluever vancluever commented Mar 26, 2025

This adds the ability to flag a profile to promote the first domain/IP to the common name. This was previously removed when promotion was deprecated, but is still allowed in the Let's Encrypt "classic" profile, so this helps mock this behavior (and also allows it to be mocked in CAs that still do the same).

@vancluever
Copy link
Author

PS: let me know if any additional tests are needed too (from what I saw, the profile functionality is not really tested so I didn't add anything in that regard).

Main rationale/motive for this PR: after I upgraded https://github.com/vancluever/terraform-provider-acme to test using the latest pebble, all of my existing tests broke, since they don't supply a profile. I'm also adding profile support, so having these additional options help me emulate Let's Encrypt specifically a bit better.

Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

Adding functionality to control CN promotion looks good to me.

I'd prefer not to add default profile functionality, however. The purpose of Pebble is not to emulate other CAs, it is to provide chaotic behavior to stress-test clients and make sure they can handle the full gamut of possible CA behaviors. The logic that a CA uses to select a profile for requests that don't specify one can be arbitrarily complex -- even Let's Encrypt's current "just pick the default" behavior is in the process of changing. So I don't think that supporting this behavior is in the interest of Pebble's goals.

@vancluever
Copy link
Author

@aarongable I guess I can take that out and I'll just set up different instances on my side with different profiles (I already do that for EAB tests). I'll adjust and update when I have time tomorrow!

PS: Do you have details on this?

even Let's Encrypt's current "just pick the default" behavior is in the process of changing.

Does this mean the classic profile is going away or will profile by required in the future?

@aarongable
Copy link
Contributor

We're in the process of launching IP-address certs, and if the new-order request contains an IP identifier, it will be defaulted to the shortlived profile rather than defaulted to the classic profile. So the defaulting logic is going to be more complex than just "pick the one marked as the default". Clients shouldn't assume that there's one default that applies across all requests, which is why Pebble chooses a profile at random.

@vancluever vancluever force-pushed the vancluever-profile-default-promote branch from 90250b7 to 9ff0957 Compare March 26, 2025 17:35
This adds the ability to flag a profile to promote the first domain/IP
to the common name. This was previously removed when promotion was
deprecated, but is still allowed in the Let's Encrypt "classic" profile,
so this helps mock this behavior (and also allows it to be mocked in CAs
that still do the same).
@vancluever vancluever force-pushed the vancluever-profile-default-promote branch from 9ff0957 to 1a4fb49 Compare March 26, 2025 17:36
@vancluever vancluever changed the title ca: Profile tweaks (default, promote CA flag) ca: allow the promotion of first domain/IP to CN in profile Mar 26, 2025
@vancluever
Copy link
Author

@aarongable updates complete; let me know if you need anything else!

Comment on lines +321 to +322
case len(ips) > 0:
cn = ips[0].String()
Copy link
Contributor

Choose a reason for hiding this comment

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

Off the top of my head I'm not 100% confident that using net.IP.String() will always be compliant with BRs Section 7.1.4.3, but this is Pebble so I'm not super concerned about it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should just not put an IP in a CN. Strategically, I want people to not rely on CNs, so I think it makes sense to omit them in Pebble

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean, I agree, which is why Boulder will never put an IP in the CN. But the purpose of Pebble is to behave differently from Boulder, to ensure that ACME clients don't over-index on Boulder's specific behavior.

wallrj pushed a commit to wallrj/cert-manager that referenced this pull request May 30, 2025
Pebble drops the CN since letsencrypt/pebble#420
Support may be added back in letsencrypt/pebble#491

Signed-off-by: Richard Wall <[email protected]>
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.

4 participants