Unable to connect client with Camunda Cloud locally

Hi all,

I’m new at Camunda and I’m trying to perform a connection to the Camunda Cloud remotely using Node:

import { Camunda8 } from "@camunda8/sdk";
import { config } from "dotenv";
import path from "path";

config();

const camunda = new Camunda8();
const zeebe = camunda.getZeebeGrpcApiClient();
const operate = camunda.getOperateApiClient();
const tasklist = camunda.getTasklistApiClient();

async function main() {
  const deploy = await zeebe.deployResource({
    processFilename: path.join(process.cwd(), "process.bpmn"),
  });
  console.log(
    `[Zeebe] Deployed process ${deploy.deployments[0].process.bpmnProcessId}`
  );
}

main();

I wrote this following this guide right here.

As I’m trying to connect to Camunda Cloud, I’m using some credentials in a .env file, as recommended by [this guide].(Set up client connection credentials | Camunda 8 Docs) Something similar to this

But when I try to run this code I’m receiving the following error:
RequestError: unable to get local issuer certificate
at ClientRequest. (C:\Users\Studying\Camunda\camunda8\node_modules\got\dist\source\core\index.js:970:111)
at Object.onceWrapper (node:events:629:26)
at ClientRequest.emit (node:events:526:35)
at ClientRequest.emit (node:domain:489:12)
at ClientRequest.origin.emit (C:\Users\Studying\Camunda\camunda8\node_modules@szmarczak\http-timer\dist\source\index.js:43:20)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:514:28)
at TLSSocket.emit (node:domain:489:12)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at TLSSocket.onConnectSecure (node:_tls_wrap:1550:34)
at TLSSocket.emit (node:events:514:28)
at TLSSocket.emit (node:domain:489:12)
at TLSSocket._finishInit (node:_tls_wrap:967:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:743:12) {
code: ‘UNABLE_TO_GET_ISSUER_CERT_LOCALLY’,
timings: {
start: 1713814781049,
socket: 1713814781051,
lookup: 1713814781081,
connect: 1713814781082,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1713814781275,
abort: undefined,
phases: {
wait: 2,
dns: 30,
tcp: 1,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 226
}
}
}

Hi @rafasilva I’ve tried to replicate this behavior, but I’m able to run your code with no issues or errors, even with a brand new cluster where the components still show a status of “creating”.

Are you trying to connect to a Self-Managed installation?

This is a certificate issue. It can be caused by a VPN, an out-of-date Node.js or OS version (missing the root certificate), or a corporate network configuration.

What Windows version and Node.js version are you using?

Try on a different network and see if you get the same issue. The certificate is issued by Lets Encrypt, so your system needs to trust Lets Encrypt certificates.

Hi everyone, thanks for your advices and support.
The reason was that I’m using a VPN software managed by my organization, as @jwulf mentioned.
I asked for support here at my company about this (the support team just needed to grant me access to “camunda.io”, a URL that was being blocked by this VPN software). Now I’m able to continue my progress!