Skip to content

Commit

Permalink
grpc-js: use tls.ConnectionOptions type for proxy connection options
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Apr 19, 2020
1 parent 48072d5 commit eef75a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/grpc-js/src/http_proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>({});
Expand Down
4 changes: 2 additions & 2 deletions packages/grpc-js/src/subchannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

0 comments on commit eef75a5

Please sign in to comment.