question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error "Unable to verify first certificate" on connection

See original GitHub issue

I cannot log-in into a cluster if my cluster ca is in the form of certificate-authority-data

(from .kube/config …)

- cluster:
    certificate-authority-data: asdfasdfasdfasdfasfdasdfasdfasdf

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:27 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
astefanutticommented, Oct 22, 2018

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 While Node sources from: https://github.com/nodejs/node/blob/v11.x/src/node_root_certs.h

The NODE_EXTRA_CA_CERTS environment variable is used by Node as a way to add extra CA certificates, as documented in https://nodejs.org/api/cli.html#cli_node_extra_ca_certs_file. It must be a file containing certificates in PEM format.

From the Node documentation, neither the well known nor extra certificates are used when the ca options property is explicitly specified for a TLS or HTTPS client, which is what Kubebox is doing when the certificate-authority-data field is present in the kubeconfig file. So that may explain why the error occurs when certificate-authority-data is present.

It’d be awesome if someone facing the issue could try setting the NODE_EXTRA_CA_CERTS, with a file containing certificates from https://golang.org/src/crypto/x509/root_linux.go.

For the error occurring with certificate-authority-data present in kubeconfig file, it may be that intermediate certificates have to be bundled in the field, e.g.:

$ cat \
 cert.pem \
 intermediate-cert.pem \
 ...
 > fullchain.pem

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 certificate-authority-data value if present.

1reaction
astefanutticommented, Oct 24, 2018

@cscetbon let me re-open #21 then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: unable to verify the first certificate in nodejs
It means that the webserver you are connecting to is misconfigured and did not include the intermediate certificate in the certificate chain it...
Read more >
Unable to Verify First Cert Issue - Enable SSL Cert Verification
Navigate to Certificate > Web Hosting > Certificates and select your SSL cert · Then right click and select “All Task” & “Export”...
Read more >
Postman responds to API calls with "Error: Unable to verify the ...
Postman does not attempt to access the users certificate store to validate the Security Controls ST Root Authority certificate.
Read more >
Unable to Verify the First Certificate with OpenSSL - Pavol Kutaj
This error means that the certificate chain is broken for OpenSSL — but does not have to be for browsers! Why? Because browsers...
Read more >
Error: unable to verify the first certificate. How to fix? - NodeBB
As that answer on SO says, the error unable to verify the first certificate means that the webserver you are connecting to is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found