Created
May 11, 2021 07:51
-
-
Save bergundy/32f181f056760928cf934d2d4f695e33 to your computer and use it in GitHub Desktop.
grpc-js mTLS connection failure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const fs = require('fs'); | |
const grpc = require('@grpc/grpc-js'); // No error if replaced with grpc | |
const Client = grpc.makeGenericClientConstructor({}, 'WorkflowService', {}); | |
const credentials = grpc.credentials.createSsl( | |
fs.readFileSync(path.join(__dirname, 'certs/cluster/ca/server-intermediate-ca.pem')), | |
fs.readFileSync(path.join(__dirname, 'certs/client/development/client-development-namespace.key')), | |
fs.readFileSync(path.join(__dirname, 'certs/client/development/client-development-namespace.pem')) | |
); | |
const client = new Client('localhost:7233', credentials, { | |
'grpc.ssl_target_name_override': 'development.cluster-x.contoso.com', | |
}); | |
client.waitForReady(Date.now() + 5000, (err) => { | |
console.log('connected?', { err }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment