-
Notifications
You must be signed in to change notification settings - Fork 142
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
Error "Unable to verify first certificate" on connection #7
Comments
I've just tried connecting with a cluster It should be supported: Lines 67 to 69 in 68fd533
Could you confirm that the |
Getting the same error message here. Using a username/password in the login box, I am able to connect to the cluster using kubectl. I provided an URL to an AWS ELB for the URL in login box, same one I found in my kube config. |
It seems the "Unable to verify first certificate" is returned when some intermediate certificates aren't bundled along with the server certificate. It may actually work with |
@loffelmacher Would you be able to share more info about your kube config content and the server certificate that may help identifying the root cause? |
Using kubeconfig file like below (just an example) is failing with Authentication failed "Unable to verify first certifcate"
I think the line "insecure-skip-tls-verify: true" enables kubectl to skip the certificate verification |
I'm experiencing the same issue. Here's my apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURDe...redacted...=
server: https://104.xxx.xxx.xxx
name: staging
contexts:
- context:
cluster: staging
user: staging
name: staging
kind: Config
preferences: {}
users:
- name: staging
user:
auth-provider:
config:
access-token: ya29.redacted
expiry: 2018-10-21T12:10:30.613021286Z
name: gcp |
Hi @sabrehagen, Looks like you are using the auth-provider section, which is slightly different. We currently don't read that section. See #14 Task is tracked by https://github.com/astefanutti/kubebox/projects/1#card-10901439 Thanks! |
@infinitydon the 'insecure-skip-tls-verify' flag is taken into account in kubebox (I use it all the time when running clusters locally). Are you experiencing the issue in the browser or when using node? |
@johnpoth -- I am facing this problem any time I initiate kubebox from my bash shell. And that is the format of the kubeconfig I am using, I can communicate with the cluster using kubectl without any issues. Is there some way to capture some log or debug? |
One possible cause could be the difference between root CA sourced from Node compared to Golang. Golang sources from: https://golang.org/src/crypto/x509/root_linux.go The From the Node documentation, neither the well known nor extra certificates are used when the It'd be awesome if someone facing the issue could try setting the For the error occurring with
If someone facing the issue for that case could be doing the test, that'd be awesome as well. Otherwise, it'd be great if someone facing the issue could confirm the above, by providing the server certificate full chain, and the non-redacted |
@astefanutti I created a file with all my certificates in it and used
But I'm using certificate-authority in my kube config with client-certificate and client-key, not certificate-authority-data so that might be not relevant to your tests ... |
@cscetbon Thanks! Here are my requests:
|
I don't have this information
wdym ? 1.9.4 nodes running coreOS
As you can see I user |
@cscetbon, thanks.
You can run the following command:
And provide the content for |
I ran your command and got one certificate back. I got also a few errors back like
I compared the returned certificate to ~/.kube/creds/dev2/ca.pem and it's different. I then tried to add that one to |
@cscetbon thanks. Interesting, it seems OpenSSL is complaining about the server certificate too, which is likely why Node fails as well. Would you be able to provide the certificate chain printed by the following command (I don't think there is any sensitive information there), e.g.:
It seems some certificates also include an "Authority Information Access" (AIA) field with intermediate CA Issuers. And intermediate certificates are not automatically fetched by Node.js (nodejs/node#16336), nor Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=399324), while Chrome implements AIA. I wonder whether Golang supports AIA or it looks for extra CA elsewhere. You could try with
Last but not least, you can check for the
Some references: |
Here is all that I can get from the different commands :
|
@cscetbon thanks. It doesn't look like there are any intermediate certificates. Could you try running the following:
And provide the content of |
@astefanutti I got more information. So I talked to someone who has all the permissions and is using the same way as me to connect. Kubebox works well for him !
So for some reason, my certificates do not allow me to use kubebox, and it seems to be because of a permission somehow, or a local library but not because of the certificates as they are generated the same way |
In the README I see Currently requires priviledged access / role. Could it be because of it ? But the error I get says "Authentication failed" |
This note only applies to fetch resource usage data. So the rest should work fine as well as the connection to the API server, given |
@astefanutti Then there is something else ... |
@cscetbon yes, there must be. By chance would you be able run |
|
As a work-around, it seems adding the certificate using the
where I still need to understand why passing the CA certificate to the HTTPS request doesn't work. |
It should be fixed with 792c0c8. The root cause was that CA option was overriding the whole list of CAs instead of appending to the list of existing root CAs. |
I cannot log-in into a cluster if my cluster ca is in the form of certificate-authority-data
(from .kube/config ...)
The text was updated successfully, but these errors were encountered: