Skip to content

Node.JS @grpc/grpc-js issue with disabling the verification of the server's TLS certificate #2811

@vinothsa4891

Description

@vinothsa4891

Problem description

We have a use case to access the gRPC service via Tunneling through a reverse proxy. The Proxy has a self-signed TLS certificate.

I see an option to disable the verification of the server's TLS certificate in client credentials. Check ServerIdentity: ()=> undefined. This is not working as I'm getting an error "Error: 14 UNAVAILABLE: No connection established. Last error: self-signed certificate in certificate chain"

const verifyOptionsFalse = {
checkServerIdentity: () => undefined,
};

const sslCreds = grpc.credentials.createSsl(
  null,
  null,
  null,
  verifyOptionsFalse 
);

this._grpcObj.<< serviceName >>(
"<< proxy_dns >>:8081",
sslCreds,
)

This is working only if I pass the server ssl_certificate ( ex : servercert.crt ) or set up process.env.NODE_TLS_REJECT_UNAUTHORIZED='0'.

Also in Golang its working by just setting "InsecureSkipVerify:false" -
creds := credentials.NewTLS(&tls.Config{
InsecureSkipVerify: true,
})

Environment
OS name, version and architecture: Linux Debian
Node version 18.19.0
Package name and version [email protected]

@murgatroid99

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions