From bcfaf04dda0e997765c4763063fd0064471a0441 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sat, 12 Oct 2019 10:17:46 -0400 Subject: [PATCH] Fix cert errors on allowHttp1 test --- test/http2/adapter_test.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/http2/adapter_test.dart b/test/http2/adapter_test.dart index 5d287a32..7773dc17 100644 --- a/test/http2/adapter_test.dart +++ b/test/http2/adapter_test.dart @@ -6,7 +6,7 @@ import 'package:angel_framework/angel_framework.dart' hide Header; import 'package:angel_framework/http2.dart'; import 'package:http/src/multipart_file.dart' as http; import 'package:http/src/multipart_request.dart' as http; -import 'package:http/http.dart' as http; +import 'package:http/io_client.dart'; import 'package:http2/transport.dart'; import 'package:http_parser/http_parser.dart'; import 'package:logging/logging.dart'; @@ -22,7 +22,7 @@ Stream> jfkStream() { void main() { var client = Http2Client(); - var h1c = http.Client(); + IOClient h1c; Angel app; AngelHttp2 http2; Uri serverRoot; @@ -98,6 +98,9 @@ void main() { ..usePrivateKey('dev.key', password: 'dartdart') ..setAlpnProtocols(['h2'], true); + // Create an HTTP client that trusts our server. + h1c = IOClient(HttpClient()..badCertificateCallback = (_, __, ___) => true); + http2 = AngelHttp2(app, ctx, allowHttp1: true); var server = await http2.startServer();