diff --git a/packages/grpc-js/src/http_proxy.ts b/packages/grpc-js/src/http_proxy.ts index 956eef4a..708b30c6 100644 --- a/packages/grpc-js/src/http_proxy.ts +++ b/packages/grpc-js/src/http_proxy.ts @@ -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 { if (!('grpc.http_connect_target' in channelOptions)) { return Promise.resolve({}); diff --git a/packages/grpc-js/src/subchannel.ts b/packages/grpc-js/src/subchannel.ts index f44d1b85..414e797d 100644 --- a/packages/grpc-js/src/subchannel.ts +++ b/packages/grpc-js/src/subchannel.ts @@ -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) {