Skip to content

Commit

Permalink
Merge pull request #2812 from vinothsa4891/bugfix/support-reject-unau…
Browse files Browse the repository at this point in the history
…thorized

Adding fix to ignore self-signed certificates verification
  • Loading branch information
murgatroid99 authored Sep 24, 2024
2 parents 0430dc5 + 7121f27 commit 3c9436b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/grpc-js/src/channel-credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface VerifyOptions {
* has been performed on the peer certificate.
*/
checkServerIdentity?: CheckServerIdentityCallback;
rejectUnauthorized?: boolean;
}

/**
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3c9436b

Please sign in to comment.