mirror of https://github.com/grpc/grpc-node.git
Moved rejectUnauthorized from channel option to connectionOptions
This commit is contained in:
parent
ca9f8c78e1
commit
9e6887368c
|
@ -53,6 +53,7 @@ export interface VerifyOptions {
|
||||||
* has been performed on the peer certificate.
|
* has been performed on the peer certificate.
|
||||||
*/
|
*/
|
||||||
checkServerIdentity?: CheckServerIdentityCallback;
|
checkServerIdentity?: CheckServerIdentityCallback;
|
||||||
|
rejectUnauthorized?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,6 +199,11 @@ class SecureChannelCredentialsImpl extends ChannelCredentials {
|
||||||
this.connectionOptions.checkServerIdentity =
|
this.connectionOptions.checkServerIdentity =
|
||||||
verifyOptions.checkServerIdentity;
|
verifyOptions.checkServerIdentity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (verifyOptions?.rejectUnauthorized) {
|
||||||
|
this.connectionOptions.rejectUnauthorized =
|
||||||
|
verifyOptions.rejectUnauthorized;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compose(callCredentials: CallCredentials): ChannelCredentials {
|
compose(callCredentials: CallCredentials): ChannelCredentials {
|
||||||
|
|
|
@ -743,7 +743,6 @@ export class Http2SubchannelConnector implements SubchannelConnector {
|
||||||
...connectionOptions,
|
...connectionOptions,
|
||||||
...address,
|
...address,
|
||||||
enableTrace: options['grpc-node.tls_enable_trace'] === 1,
|
enableTrace: options['grpc-node.tls_enable_trace'] === 1,
|
||||||
rejectUnauthorized: options['grpc-node.tls_reject_unauthorized'] ?? true,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* http2.connect uses the options here:
|
/* http2.connect uses the options here:
|
||||||
|
@ -838,9 +837,6 @@ export class Http2SubchannelConnector implements SubchannelConnector {
|
||||||
if (options['grpc-node.tls_enable_trace']) {
|
if (options['grpc-node.tls_enable_trace']) {
|
||||||
connectionOptions.enableTrace = true;
|
connectionOptions.enableTrace = true;
|
||||||
}
|
}
|
||||||
if (options['grpc-node.tls_reject_unauthorized']) {
|
|
||||||
connectionOptions.rejectUnauthorized = options['grpc-node.tls_reject_unauthorized'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return getProxiedConnection(address, options, connectionOptions).then(
|
return getProxiedConnection(address, options, connectionOptions).then(
|
||||||
|
|
Loading…
Reference in New Issue