grpc-js: use tls.ConnectionOptions type for proxy connection options

This commit is contained in:
Tom Kirkpatrick 2020-04-19 20:02:38 +02:00
parent 48072d5f4f
commit eef75a5c1b
No known key found for this signature in database
GPG Key ID: 72203A8EC5967EA8
2 changed files with 3 additions and 4 deletions

View File

@ -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>({});

View File

@ -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) {