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
CN was longer than 64 bytes #1462
Comments
|
This is working as expected - it's against spec to issue certs with CNs longer than 64 characters. You can see some discussion on this here: https://community.letsencrypt.org/t/a-certificate-for-a-63-character-domain/78870 Right now, the advised workaround is to include a shorter common name alongside the long dns name (as let's encrypt don't allow you to leave the CN field blank). There's some more discussion on removing this requirement here: letsencrypt/boulder#2093 |
|
I think the best we can do is to update this doc here: https://github.com/jetstack/cert-manager/blob/master/docs/tasks/acme/issuing-certificates.rst to include a note stating that the max length is 64 chars 😄 |
|
There is no control over CN with the ingress shim? |
Unfortunately this won't work. The identifiers in the CSR Subj. CN/SANs need to be an exact match to the identifiers in the ACME order or the order finalization request carrying the CSR will be rejected. |
|
I just did a manual work to insert an additional 70-char long dns name into ingress that has a short name in place, and this is the cert I got:
If Let's Encrypt requires (a shorter) CN to be validated via HTTP or DNS solver - not just SAN-s - I can do that. Let me explain a bit... We do automation with / on top of Kubernetes. Our stacks are Kubernetes clusters with applications, CI, DNS, etc., and now TLS - hopefully with Let's Encrypt - fully automated from the code. The default DNS structure is |
We have a similar setup with review apps on GitLab, and simply truncate the branch/app name to an appropriate length before creating the Certificate resource here. cert-manager itself can't really start manually truncating DNS names for you, as this is a violation of our API spec (i.e. user asks for a cert with a particular name, and so they should receive a cert with that name and not another). If anything, I think we should tighten our own validation so that we bail out earlier and don't allow you to create a Certificate with a CN length >64 chars. This isn't something we'll be able to handle automatically, as it's effectively a user configuration error. As you've noted, it is possible to create a Certificate with a CN that is short, and a longer DNS name. I'd advise you do this for now if possible! |
|
The issue is about mechanics of ingress shim. This is not about requesting a cert and getting one with a different name - the automation does not work with Certificate resource directly. TLS is a leaking abstraction. As a user, effectively a software component that requires ingress, I care no about certificate/key and it's management - that's an implementation detail. I install ingress and expect it to be TLS-protected. The To me it looks like there is a combination of transformations performed by the shim that could make it work. Yes, the name that is put in CN will be shorter, but I don't care. Given a choice of (a) not having long DNS names TLS protected and (b) preserving compatibility, my choice is to get long DNS names working. |
|
I understand your point here, but I'm not really sure what we can do in this instance. ingress-shim cannot reliably predict what CN should be used, in the instance where the only name on an ingress is a long one (i.e. longer than 64 chars). Any kind of guess work, i.e. truncating at {some point}, will cause confusion for users when we guess incorrectly. As you say, adding the annotations and The behaviour of ingress-shim can be defined as "it will create a Certificate resource that contains all the named hostnames on it, using your configured issuer, and setting the first hostname as the common name on the certificate". This is exactly what's going on here, except the first entry on your Ingress resource is technically an invalid CN, as it's greater than 64 characters. We should better document that this is how ingress-shim behaves, but beyond that I am strongly against us attempting to automatically determine a 'safe' value to insert here. In short:
|
|
This isn't a deficiency in the ACME solver - it's ingress-shim working as intended, and unfortunately the first DNSName you've provided here is not valid for use as a common name. You can quickly work around this by adding some other entry to your should be |
|
Good enough, that works for me. Agree, the safe value for CN is user specific. Creating a configurable machinery to satisfy Let's Encrypt |
|
Is this solution works also when using http challenge validation ? |
|
It works for me - both with http and dns solvers. The first (shorter than 64 chars) element in |
|
Ok perfect, so the first name should be always http resolvable, it means to always carry on both domains. Thanks for letting me know. |

Using ingress shim to auto-provision certificates.
For ingress resource:
a Certificate resource is installed (by the shim):
That's lead to following error:
cert-manager v0.7.0-beta.0.
/kind bug
The text was updated successfully, but these errors were encountered: