Skip to content
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 the first certificate #688

Open
minotaurrr opened this issue Dec 14, 2020 · 0 comments
Open

Error: unable to verify the first certificate #688

minotaurrr opened this issue Dec 14, 2020 · 0 comments

Comments

@minotaurrr
Copy link

Hi i thought this was related to the insecureSkipTlsVerify option in the client but setting it to true doesn't seem to fix the issue..

    const client = new Client({
      config: {
        url: CLUSTER_ENDPOINT,
        auth: {
          bearer: getBearerToken(CLUSTER_NAME),
        },
        insecureSkipTlsVerify: true,
      },
      version: '1.13',
    });

    const pods = await client.api.v1.namespaces(NAMESPACE).pods.get();
    const containerName = pods.body.items[0].spec.containers[0].name;
    const podName = pods.body.items[0].metadata.name;
    console.log(`Connecting to pod: ${podName}`);
    console.log(`Connecting to container: ${containerName}`);
    const res = await client.api.v1
      .namespaces(NAMESPACE)
      .pods(podName)
      .exec.post({
        qs: {
          command: ['ls', '-a'],
          container: containerName,
          stdout: true,
          stderr: true,
        },
      });

    console.log(res.body);
    console.log(res.messages);

I get this error when i run the above, any idea how to fix?

Error: unable to verify the first certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1502:34)
    at TLSSocket.emit (events.js:314:20)
    at TLSSocket._finishInit (_tls_wrap.js:937:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:711:12) {
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  messages: []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant