i have a self signed grpc service on server, and got it working for dart server with dart client. But i could not figure how to bypass or allow self signed certificate for node client.. I've tried this:
const sslCreds = await grpc.credentials.createSsl(
fs.readFileSync('./ssl/client.crt'),
null, // privatekey
null, // certChain
{
checkServerIdentity: function(host, info) {
console.log('verify?', host, info);
if (
host.startsWith('127.0.0.1') ||
host.startsWith('logs.example.com')
) {
return true;
}
console.log('verify other?', host);
return true;
},
},
);
// sslCreds.options.checkServerIdentity = checkCert;
const gLogClient = new synagieLogGrpc.LoggerClient(
'host:port',
sslCreds,
);
but when i call, my validation checkServerIdentity did not call.
anyone have any clue?