-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cockroach sql --client-certs option fails if node.crt/node.key files without "node" subject are found in <certs dir> #47476
Comments
I think this is a dup of #47210. For the |
Probably same root cause. Do we want to deprecate --certs-dir or overhaul it to be command context sensitive? |
My preference is to deprecate Also, @bdarnell do you want to weigh in here? I can't recall the history of how we ended up using |
Are we discussing deprecating |
No, it is much too late in the 20.1 cycle for that. The earliest we could deprecate it is 20.2. |
I vote deprecate as well, if the flag doesn't have a well defined behavior but we have equivalent functionality with common behavior to postgres this sounds like an easy win. My only misgiving is that the --url connection strings are ugly from a UX standpoint - but this hardly outweighs the cost of redesigning the --certs-dir flag. |
I think it is well-defined, it just has a bug that it tries to "validate" stuff it finds in that directory that it has no business caring about. I don't see a reason to deprecate; getting to the point where we could remove it would be a pretty heavy lift since this has been the process since the early days. I'd close this as a dupe of #47210 |
I reread the docs page here: https://www.cockroachlabs.com/docs/v20.1/cockroach-cert.html#node-key-and-certificates and see that most of the expected certificate load paths are called out in an easy to read tabular form though split across a couple sections (with the exception of the ui which is in a sentence below one table). Maybe I skimmed the docs too quickly when I filed this. But I guess I expected to see a description of all the defaults the flag implied in one place. However, this is a more minor quibble so I retracted the claim that this behavior is ambiguous. I'm not sure it's a dup of #47210 as the CLI fails to run if the operator follows our previously (and currently) documented pathing convention in conjunction with the new --cert-principal-map flag. If the cockroach sql command finds a node cert that it can't validate - it halts. Changing issue name to reflect this - pen to additional thoughts though. |
The And I still think it's a dupe of #47210 because |
Thanks for the clarification and that makes sense, closing as a dup of #47210. |
cockroach sql --certs-dir=<certs dir>
does not load correct client certs if node cert is present in<certs dir>
.To Reproduce
Create node and user certificates and store them in the same directory. (This behavior ignores the user flag)
However, renaming the certificate files for
node.*
results in:Expected behavior
Command will walk certificates in the
<cert dir>
and match the correct one to the implied or supplies principle.Environment:
Thanks @Amruta-Ranade for helping identify this.
CC @knz @petermattis
xref: #47300
xref: #47449
xref: cockroachdb/docs#7104
xref: https://www.cockroachlabs.com/docs/dev/connection-parameters.html
The text was updated successfully, but these errors were encountered: