Omit port number from servername option

This commit is contained in:
Michael Lumish 2020-06-19 08:56:48 -07:00
parent 5edab2bbd3
commit cd8743e569
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.1.0",
"version": "1.1.1",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

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 { GrpcUri, parseUri } from './uri-parser';
import { GrpcUri, parseUri, splitHostPort } from './uri-parser';
import { ConnectionOptions } from 'tls';
import { FilterFactory, Filter } from './filter';
@ -309,8 +309,9 @@ export class Subchannel {
};
connectionOptions.servername = sslTargetNameOverride;
} else {
const authorityHostname = splitHostPort(targetAuthority)?.host ?? 'localhost';
// We want to always set servername to support SNI
connectionOptions.servername = targetAuthority;
connectionOptions.servername = authorityHostname;
}
if (proxyConnectionResult.socket) {
/* This is part of the workaround for