-
Notifications
You must be signed in to change notification settings - Fork 113
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
The cluster request failed for an unknown reason: unable to verify the first certificate #791
Comments
Hello! Do you see the same error when attempting to run |
no, |
Hi, I have a couple more questions: Were these clusters added to the kubeconfig manually or via the extension? If they were added manually could you try adding via the "+" button in the Kuberenetes explorer? Also for the certificate-authority-data field on your cluster, do you see a hash value like LS0... or something else? Thanks! |
Hello! Thank you for the support!
|
+1 |
I'm still investigating the issue, but I've not been able to reproduce the issue such that kubectl can still connect but the extension cannot. Do you maybe have some necessary certificates configured outside of the vscode environment? If you have managed dependencies turned on ("cloudcode.autoDependencies": "on" in the vscode settings), the extension will be using a different instance of kubectl than what you have pre-installed; which might be contributing to this issue. You could try toggling that to "off" to see if it helps. Lastly, are there any special settings on the clusters you are trying to connect to? Or would a freshly made cluster with default settings still fail with this error? Thanks! |
Hello! In order: Thank you! |
Thanks for testing that out! And it sounds like these aren't private clusters either (https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept); Cloud Code doesn't support private clusters at this time. Are you using the default kubeconfig (HOME/.kube/config) or some other kube file? Can you confirm by comparing the output of Could you also run I'm still trying to get a repro on my side, but I really appreciate you trying these things out to help debug the issue in the meantime. |
Oh and for the comparing certificates, the Could you also check if NODE_EXTRA_CA_CERTS environment variable is set? That might also be conflicting. |
|
+1 |
Another workaround could be to set clusters:
- cluster:
insecure-skip-tls-verify: true Are you trying to access you in a corporate network or other place where you might be subject to a TLS decrypting firewall? Do other TLS connections on your machine rely on a custom certificate installed in Keychain Access? If kubectl works, this is very likely the case. kubectl is written in golang which grabs all certificates from Keychain Access. NodeJS (which VS Code extensions are written in) instead keeps a static list of root certificates. If so, a workaround would be to export that certificate as a PEM file and set |
That workaround was helpful. Thank you @j-windsor
Copied the entire value of |
Hi! thanks for providing a detailed solution. |
Make sure you are setting the environment variable in a way that VS Code can access it. I would recommend adding it to your default shell .rc file so it is available everywhere you could open VS Code. I would also recommend using a certificate from a trusted CA, likely from your enterprise in this case. I've never used it before, but this also looks promising. An extension that loads all certificates on your mac into VS Code like kubectl does. |
Closing this issue, as there is unfortunately nothing we can do about this on our side. |
Please see #812 (comment) and see if that works for you. I believe the real solution to this problem is to disable VS Code's overriding of HTTP request options that include the CA cert from the KubeConfig. |
This last turned out to be the solution! Thank you @j-windsor |
Type: Bug
Context
Add a google cluster and try to connect to it through the extension. It throws the error: The cluster request failed for an unknown reason: unable to verify the first certificate
Extension version: 1.21.5
VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T15:00:40.428Z)
OS version: Darwin arm64 22.4.0
Modes:
Sandboxed: Yes
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: