Skip to content

Commit 2e008d1

Browse files
authored
Merge pull request #1970 from murgatroid99/grpc-js_checkServerIdentity_fix
grpc-js: Don't pass undefined checkServerIdentity
2 parents e675406 + 3106057 commit 2e008d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/grpc-js/src/channel-credentials.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,12 @@ class SecureChannelCredentialsImpl extends ChannelCredentials {
183183
ciphers: CIPHER_SUITES,
184184
});
185185
this.connectionOptions = {
186-
secureContext,
187-
checkServerIdentity: verifyOptions?.checkServerIdentity
186+
secureContext
188187
};
188+
// Node asserts that this option is a function, so we cannot pass undefined
189+
if (verifyOptions?.checkServerIdentity) {
190+
this.connectionOptions.checkServerIdentity = verifyOptions.checkServerIdentity;
191+
}
189192
}
190193

191194
compose(callCredentials: CallCredentials): ChannelCredentials {

0 commit comments

Comments
 (0)