Use host without port as authority when making secure connection (#238)

This commit is contained in:
Sigurd Meldgaard 2019-09-09 08:41:56 +01:00 committed by Michael Thomsen
parent 8e23f00f41
commit 20352dd718
3 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
## 2.1.2
* Fix bug introduced in 2.1.1 where the port would be added to the default authority when making a
secure connection.
## 2.1.1
* Fix bug introduced in 2.1.0 where an explicit `authority` would not be used when making a secure

View File

@ -81,7 +81,11 @@ class Http2ClientConnection implements connection.ClientConnection {
if (securityContext != null) {
// Todo(sigurdm): We want to pass supportedProtocols: ['h2']. http://dartbug.com/37950
socket = await SecureSocket.secure(socket,
host: authority,
// This is not really the host, but the authority to verify the TLC
// connection against.
//
// We don't use `this.authority` here, as that includes the port.
host: options.credentials.authority ?? host,
context: securityContext,
onBadCertificate: _validateBadCertificate);
}

View File

@ -1,7 +1,7 @@
name: grpc
description: Dart implementation of gRPC, a high performance, open-source universal RPC framework.
version: 2.1.1
version: 2.1.2
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/grpc-dart