-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
using a CN of length >65 throws an idna: invalid label error #11721
Comments
Hi, it has been 5 months now, and we have discovered the workaround is not ideal due to the fact that anything could be present in the CSR and issued. Could somebody point me in the right direction as to whether we are breaking a standard by asking for > 64 characters, or whether this is a something enforced because most certificates are web based? |
Hi @darkedges - thanks for your patience. Our engineers are working on researching this further. Appreciate you bringing this back up! :) |
Thanks @hsimon-hashicorp, appreciated. We could fix it (to our immediate need), but when we go Enterprise we would prefer to have it properly maintained and not have to apply changes each time the product upgrades. |
Hi @darkedges! I spoke to an expert on this, and he states that |
Hi @hsimon-hashicorp IIRC that option only is useful if the CN an |
Hi @darkedges! I took a look at the code: vault/builtin/logical/pki/cert_util.go Lines 794 to 817 in 30fd91c
|
Thanks @hsimon-hashicorp, I have reviewed my test case again and worked out the issue after testing on 1.5.2, 1.7.3 and 1.8.3. and now believe it was a misunderstanding on my behalf around I think first I wanted to know what else could be broken if I used the HC Vault is only allowing
the certficate generated will only contain I have raised #12912 to get that feature added. Will close this issue. |
Closing and moving to feature request |
Describe the bug
When I create a CSR with a Subject DN of
UID=f0486469-6aa7-4a93-8cc2-3e64f30e1789,CN=Nicholas Peter Irving
it fails to be signed with an error ofIt seems to be checking to see if the CN is less than 64 (it seems to be excluding spaces) characters in length because of this setting
https://github.com/hashicorp/vault/blob/master/builtin/logical/pki/cert_util.go#L790
The afforementioned code is
https://pkg.go.dev/golang.org/x/net/idna#VerifyDNSLength
https://github.com/golang/net/blob/abc453219eb586afb3fc1742e8c685c28b9f7eea/idna/idna10.0.0.go#L409
Should we be enforcing DNS requirements on the CN, as I am not necessarily creating a TLS Certificate, instead it is a message signing certificate that is not email specific.
Now I have found that if I use
exclude_cn_from_sans
I can get it signed correctly, but I am unsure what else breaks with that option. I would also have to get the developed of the HashiCorp Java Vault to include that option in their code base.To Reproduce
Steps to reproduce the behavior:
UID=f0486469-6aa7-4a93-8cc2-3e64f30e1789,CN=Nicholas Peter Irving
Expected behavior
return a Sign Certificate response.
Environment:
vault status
):1.5.2
vault version
):1.5.2
Container Image from DockerHub
Vault server configuration file(s):
# Docker default
Additional context
N/A
The text was updated successfully, but these errors were encountered: