Skip to content
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

Add alternate chains of varying path length #318

Closed
alexzorin opened this issue Aug 3, 2020 · 4 comments · Fixed by #320
Closed

Add alternate chains of varying path length #318

alexzorin opened this issue Aug 3, 2020 · 4 comments · Fixed by #320

Comments

@alexzorin
Copy link
Contributor

@jvanasco suggests in this forum post that ACME clients might not be able to handle downloading a certificate chain that is longer than just end-entity+issuer.

We could add this variation to strict mode.

These chains do happen in real life (check what certificates are sent by gogetssl.com for example) and since pretty much the entire point of Pebble is to be a stickler for the rules, I think it should be added.

@felixfontein
Copy link
Contributor

I don't think this should be limited to strict mode, but it should be available always. For backwards compatibility, it should require explicit enabling though.

@jvanasco
Copy link
Contributor

jvanasco commented Aug 4, 2020

No client I've seen has handled this properly, until Certbot recently merged this PR (from @alexzorin of all people!) https://github.com/certbot/certbot/pull/7877/files

For lack of time to properly handle this on my client, I just "do whatever certbot does".

The best-case typical client will correctly pull out the first cert... but then group all subsequent certs together into a "fullchain". this is somewhat correct - most systems should handle this fine - however it does not differentiate between the discrete certs in the fullchain component. (i.e. they always generates a 2 item chain; if there is one upchain cert then we see [cert, upchain] but if there are 2 or more upchain certs, we see [cert, upchain1+upchain2].

However... many clients just use regex or string splits, and pull out the 1st and 2nd items from the result.

@alexzorin
Copy link
Contributor Author

Feedback welcome in #320!

@felixfontein
Copy link
Contributor

@jvanasco I really wonder why no other client bothered to implement that, since it was pretty obvious from the RFC that this could happen. (I did implement it for my client, and the PR finally showed that the code I wrote actually works in real life ;) )

@jsha jsha closed this as completed in #320 Aug 27, 2020
jsha pushed a commit that referenced this issue Aug 27, 2020
This commit adds a way to control how long the certificate issuance
chains that Pebble uses are. The default and minimum value of 1 means
that there is one intermediate certificate in the final certificate
chain.

Fixes #318.


The resulting certificate chain (at a value of `2`) looks like this:

    $ cat b.pem | openssl crl2pkcs7 -nocrl -certfile /dev/stdin | openssl pkcs7 -print_certs -noout
    subject=CN = xfoobazx.com
    issuer=CN = Pebble Intermediate CA 2f1dd1
    subject=CN = Pebble Intermediate CA 2f1dd1
    issuer=CN = Pebble Intermediate CA 5a564f
    subject=CN = Pebble Intermediate CA 5a564f
    issuer=CN = Pebble Root CA 0335fe

The change is a little bit awkward because Pebble has been, in parts, written with an
assumption about there being one intermediate.

The additional intermediates are not exposed via the management interface. It might
be possible to make a non-breaking change to `:15000/intermediate-keys/`, but I
haven't been able to think of a use-case for exposing them.
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 a pull request may close this issue.

3 participants