mirror of https://github.com/grpc/grpc-node.git
grpc-js: use tls.ConnectionOptions type for proxy connection options
This commit is contained in:
parent
48072d5f4f
commit
eef75a5c1b
|
@ -24,7 +24,6 @@ import { Socket } from 'net';
|
|||
import * as http from 'http';
|
||||
import * as tls from 'tls';
|
||||
import * as logging from './logging';
|
||||
import { SecureClientSessionOptions } from 'http2'
|
||||
import {
|
||||
SubchannelAddress,
|
||||
isTcpSubchannelAddress,
|
||||
|
@ -161,7 +160,7 @@ export interface ProxyConnectionResult {
|
|||
export function getProxiedConnection(
|
||||
address: SubchannelAddress,
|
||||
channelOptions: ChannelOptions,
|
||||
connectionOptions: SecureClientSessionOptions
|
||||
connectionOptions: tls.ConnectionOptions
|
||||
): Promise<ProxyConnectionResult> {
|
||||
if (!('grpc.http_connect_target' in channelOptions)) {
|
||||
return Promise.resolve<ProxyConnectionResult>({});
|
||||
|
|
|
@ -28,7 +28,7 @@ import * as logging from './logging';
|
|||
import { LogVerbosity } from './constants';
|
||||
import { getProxiedConnection, ProxyConnectionResult } from './http_proxy';
|
||||
import * as net from 'net';
|
||||
import * as tls from 'tls';
|
||||
import { ConnectionOptions } from 'tls';
|
||||
|
||||
const clientVersion = require('../../package.json').version;
|
||||
|
||||
|
@ -420,7 +420,7 @@ export class Subchannel {
|
|||
* upgrade it's connection to support tls if needed.
|
||||
* This is a workaround for https://github.com/nodejs/node/issues/32922
|
||||
* See https://github.com/grpc/grpc-node/pull/1369 for more info. */
|
||||
const connectionOptions: http2.SecureClientSessionOptions =
|
||||
const connectionOptions: ConnectionOptions =
|
||||
this.credentials._getConnectionOptions() || {};
|
||||
|
||||
if ('secureContext' in connectionOptions) {
|
||||
|
|
Loading…
Reference in New Issue