Using SDK with API behind LetsEncrypt


I installed the Chirpstack stack following the GCP guide ( The bridge is installed on the gateways.

I did not install the TLS certificates ( because everything is on a private network and the only public component is the application server. I secured the access to the application server with LetsEncrypt.

Now I would like to use the javascript SDK to call the API ( I try to get a device with the following snippet:

const grpc = require('grpc');
const nsDeviceService = require('@chirpstack/chirpstack-api/as/external/api/device_grpc_pb');
const { GetDeviceRequest } = require('@chirpstack/chirpstack-api/as/external/api/device_pb');

const deviceServiceClient = new nsDeviceService.DeviceServiceClient(

const metadata = new grpc.Metadata();
  'Bearer <API_TOKEN>'

const reqArgs = new GetDeviceRequest();
deviceServiceClient.get(reqArgs, metadata, (error, response) => {
  if (error) {
  } else {
    console.log("it works!");

I get the following error:

Error: 1 CANCELLED: Received http2 header with status: 404

I get the same error if I add the port number (i.e.: :443).

If I try it using grps.credentials.createInsecure(), I get this error:

Error: 14 UNAVAILABLE: Trying to connect an http1.x server

I am able to call the API using cURL or the swagger page, so I don’t understand why I get this problem.

Could someone please help me?