diff --git a/packages/grpc-js/src/channel-credentials.ts b/packages/grpc-js/src/channel-credentials.ts index d238748b4..60a553c39 100644 --- a/packages/grpc-js/src/channel-credentials.ts +++ b/packages/grpc-js/src/channel-credentials.ts @@ -54,6 +54,7 @@ export interface VerifyOptions { * has been performed on the peer certificate. */ checkServerIdentity?: CheckServerIdentityCallback; + rejectUnauthorized?: boolean; } /** @@ -207,6 +208,11 @@ class SecureChannelCredentialsImpl extends ChannelCredentials { this.connectionOptions.checkServerIdentity = verifyOptions.checkServerIdentity; } + + if (verifyOptions?.rejectUnauthorized !== undefined) { + this.connectionOptions.rejectUnauthorized = + verifyOptions.rejectUnauthorized; + } } compose(callCredentials: CallCredentials): ChannelCredentials {