-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
CLI ignoring certificate-related flags #2946
Comments
Do you see the same issues with the official binary from https://releases.hashicorp.com/vault/0.7.3/vault_0.7.3_darwin_amd64.zip ? |
@jefferai yes, I do. |
I have been trying to recreate this issue but have been unable to do so. I used the |
I have been trying to authenticate using client certificates as well and running into a similar (possibly the same) issue with vault 0.8.3. Server setup:
Client setup:
I get an error about the client certificate when I attempt to authenticate, and no attempt is made to connect to the vault server:
Strangely, I get a different error if I reference the original paths for the certificate and key (note, this is a puppet agent certificate):
In this case, there is connection made to the server but nothing is logged there. |
@inkblot in the first example, are those symlinks? It's possible we don't follow symlinks for those flags; if so, I'm not sure if there is a reason for that. Are you using HA? If so is the second request against a standby or active node? |
@jefferai They are copies, not symlinks. Ownership and permissions have been altered, but otherwise they're the same. HA: There are two instances, but I'm not sure I'm doing it right. Wouldn't that just produce hit or miss results if that were the cause? I'm getting consistent errors. |
More to the point on HA... I'm using a consul backend. I have a consul-template configured nginx reverse proxy that is forwarding tcp streams to vault. The rendered nginx configuration has an upstream for vault that points to exactly one of the two actual vault instances. I can confirm by querying consul that this node is marked |
What are those errors? |
The errors on the standby are irrelevant. I have shut the standby down and I still get the same client error when I try to use TLS auth. |
I can't reproduce on master:
|
It looks like you're supplying a CA cert as the client certificate. I assume that means it's self-signed. Does vault require that the client certificate is self-signed? What about key usage? |
I am not using a CA cert as the client cert, I'm using one with server/client usage. |
Pardon, I misread the args. Is the CA certificate for that client cert known to vault? |
Yes, the same CA issued both the client and server certs. |
Is that a requirement? |
No, it is not. |
about the CA used to sign the cert. Stop swallowing an error in meta. Fixes #2946
Using Vault v0.7.3 ('0b20ae0b9b7a748d607082b1add3663a28e31b68') on macOS 10.12.5 installed from Homebrew.
I am really stumped by the fact that the CLI seems to be ignoring certificate related flags, including
-ca-cert
,-client-cert
,-client-key
, and-tls-skip-verify
.I am following the directions from https://www.vaultproject.io/docs/auth/cert.html#authentication.
The instructions for curl work fine, but for the vault CLI I always get:
Put https://127.0.0.1:8200/v1/auth/cert/login: x509: certificate signed by unknown authority
The command-line I'm using is an exact copy from the docs above, except with different paths for the various files.
Passing in
-tls-skip-verify
has no effect, but settingVAULT_SKIP_VERIFY=1
does, and results in:So it seems like the CLI is not even seeing that I have set those flags. I ran
dtruss
on the command, and the files I am passing in for CA cert, client cert and client key are neitherstat64()
ed noropen()
ed.I've tried both
vault auth
andvault list
commands without success.Things work fine if I set the
VAULT_CACERT
,VAULT_CLIENT_CERT
andVAULT_CLIENT_KEY
environment variables.The text was updated successfully, but these errors were encountered: