-
Notifications
You must be signed in to change notification settings - Fork 682
Closed
Labels
Description
Problem description
Setting grpc.ssl_target_name_override uses the checkServerIdentity function to check the certificate against a different hostname. However, this makes it impossible to specify a custom checkServerIdentity function to perform extra checks.
Reproduction steps
- generate typescript code from proto (I used
protoc-gen-ts, client class signature wasexport class SomeClient extends grpc_1.makeGenericClientConstructor(UnimplementedNodeManagerService.definition, "Some", {}) { ...) - initialize the client with TLS (
createSsl(..., { checkServerIdentity: () => { console.log('got here'); return undefined; } }) or analogously withcreateFromSecureContext; - connect to a server ensuring all certificates are in order;
- observe connection is successful but 'got here' does not get printed.
Environment
- OS name, version and architecture: macOS Sonoma 14.2.1
- Node version: v21.7.1
- Node installation method: brew (I think?)
- If applicable, compiler version: N/A
- Package name and version: @grpc/grpc-js 1.10.4
Additional context
I'm trying to specify a custom checkServerIdentity function to extract some data from the server's certificate. Perhaps it's not the way to do it, but that's how I came across this. Not sure if this is expected but surely threw me off and had me stuck for a while trying to trace back the piece of code that calls/overrides the function.