No Connection Established Error When Running With TLS Locally and connecting from node client

**Setup: **
A single secure node and a node-js gRPC client.
The es node is running on a docker “bridge” network called es-db-net.
es-db-net has an address space of 172.19.0.0/16. On this network es-db server is assigned the ip address “172.19.0.3” and the node server is assigned the ip address “172.19.0.2”.
There are no ports exposed to the docker host.
The node server is running on port 5000, and the es-db server’s http port is set to 3000

After docker-compose up --build you can use curl 172.19.0.1:5000/app to invoke the simple test function which was copy pasted from the client page on npm’s website

This error appears on the terminal :

nodejs-server | (node:33) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version. nodejs-server | (Usenode --trace-deprecation …` to show where the warning was created)
nodejs-server | /home/app/node_modules/@eventstore/db-client/dist/utils/CommandError.js:280
nodejs-server | return new UnavailableError(error);
nodejs-server | ^
nodejs-server |
nodejs-server | UnavailableError: 14 UNAVAILABLE: No connection established
nodejs-server | at Object.convertToCommandError (/home/app/node_modules/@eventstore/db-client/dist/utils/CommandError.js:280:20)
nodejs-server | at Object.callback (/home/app/node_modules/@eventstore/db-client/dist/streams/appendToStream.js:44:39)
nodejs-server | at Object.onReceiveStatus (/home/app/node_modules/@grpc/grpc-js/build/src/client.js:247:36)
nodejs-server | at Object.onReceiveStatus (/home/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
nodejs-server | at Object.onReceiveStatus (/home/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
nodejs-server | at /home/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78
nodejs-server | at processTicksAndRejections (node:internal/process/task_queues:78:11) {
nodejs-server | code: 14,
nodejs-server | _raw: Error: 14 UNAVAILABLE: No connection established
nodejs-server | at Object.callErrorFromStatus (/home/app/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
nodejs-server | at Object.onReceiveStatus (/home/app/node_modules/@grpc/grpc-js/build/src/client.js:247:52)
nodejs-server | at Object.onReceiveStatus (/home/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141)
nodejs-server | at Object.onReceiveStatus (/home/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181)
nodejs-server | at /home/app/node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78
nodejs-server | at processTicksAndRejections (node:internal/process/task_queues:78:11) {
nodejs-server | code: 14,
nodejs-server | details: ‘No connection established’,
nodejs-server | metadata: Metadata { internalRepr: Map(0) {}, options: {} }
nodejs-server | },
nodejs-server | type: ‘unavailable’
nodejs-server | }

`

The connection string is : esdb://172.19.0.3:3000?tls=true&tlsVerifyCert=false

Note:
1-Commenting out all ca path as well as the path to node certificate and its private key and changing the connection string to esdb://172.19.0.3:3000?tls=false works perfectly.

2-Certificates were generated with eventstore cli.
3-On my machine, following the exact steps on this page Docker Secure Cluster and using

const client = EventStoreDBClient.connectionString("esdb://localhost:2111,localhost:2112,localhost:2113?tls=true&tlsVerifyCert=false")
to connect results in a Failed to discover after 10 attempts error

I tried to troubleshoot these errors to the best of my ability. I couldn’t find any thing similar to this on the internet. So, I don’t know if these errors are exclusive to my machine or it’s me who’s setting things up the wrong way for some reason. Looking forward to hearing your suggestions about what the might be the problem. Thanks

**Docker Compose file **

`version: “3.7”
services:
nodejs-server:
build: ./server
container_name: nodejs-server
volumes:
- ./server:/home/app
networks:
es-db-net:
ipv4_address: 172.19.0.2
depends_on:
- eventstoredb-node
eventstoredb-node:
image: eventstore/eventstore:21.6.0-buster-slim
environment:
- EVENTSTORE_CLUSTER_SIZE=1
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_START_STANDARD_PROJECTIONS=true
- EVENTSTORE_HTTP_PORT=3000
#- EVENTSTORE_INSECURE=true
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/certs/ca
- EVENTSTORE_CERTIFICATE_FILE=/certs/node3/node.crt
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/certs/node3/node.key
networks:
es-db-net:
ipv4_address: 172.19.0.3
volumes:
- ./certs:/certs
networks:
es-db-net:
driver: bridge
ipam:
config:
- subnet: 172.19.0.0/16

Client Setup

const express = require(“express”);
const {EventStoreDBClient, jsonEvent, START, FORWARDS} = require("@eventstore/db-client");
const connectionStringTls = “esdb://172.19.0.3:3000?tls=true&tlsVerifyCert=false”;
const connectionString = “esdb://172.19.0.3:3000?tls=false”;
const port = 5000;
const client = EventStoreDBClient.connectionString(connectionStringTls);
const app = express();
async function simpleTest() {
const streamName = “es_supported_clients_1”;
const event = jsonEvent({
type: “grpc-client”,
data: {
languages: [“typescript”, “javascript”, “java”],
runtime: “NodeJS”,
},
});
const appendResult = await client.appendToStream(streamName, [event]);
const events = client.readStream(streamName, {
fromRevision: START,
direction: FORWARDS,
maxCount: 5,
});
for await (const event of events) {
console.log(“here:”, event);
}
}
app.get("/app", (res, res)=> simpleTest());
app.get("/", (res, res)=> res.send(“hello”));
app.listen(port, ()=>{
console.log("server listening on port: "+ port);
});
`

node CA extensions

X509v3 extensions: X509v3 Key Usage: critical Digital Signature, Key Encipherment X509v3 Extended Key Usage: TLS Web Client Authentication, TLS Web Server Authentication X509v3 Basic Constraints: critical CA:FALSE ..... X509v3 Subject Alternative Name: IP Address:172.19.0.3