Index: tests/standalone/io/https_unauthorized_test.dart |
diff --git a/tests/standalone/io/https_unauthorized_test.dart b/tests/standalone/io/https_unauthorized_test.dart |
index 0bb6c897ff6b54d3bd797a74f75fc72378d27098..43f3e53b7417909ace3491380e780b6a2b69e392 100644 |
--- a/tests/standalone/io/https_unauthorized_test.dart |
+++ b/tests/standalone/io/https_unauthorized_test.dart |
@@ -13,13 +13,19 @@ import "dart:io"; |
const HOST_NAME = "localhost"; |
const CERTIFICATE = "localhost_cert"; |
-Future<SecureServerSocket> runServer() { |
- SecureSocket.initialize( |
- database: Platform.script.resolve('pkcert').toFilePath(), |
- password: 'dartdart'); |
+String localFile(path) => Platform.script.resolve(path).toFilePath(); |
+ |
+SecurityContext untrustedServerContext = new SecurityContext() |
+ ..useCertificateChain(localFile('certificates/untrusted_server_chain.pem')) |
+ ..usePrivateKey(localFile('certificates/untrusted_server_key.pem'), |
+ password: 'dartdart'); |
+SecurityContext clientContext = new SecurityContext() |
+ ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem')); |
+ |
+Future<SecureServerSocket> runServer() { |
return HttpServer.bindSecure( |
- HOST_NAME, 0, backlog: 5, certificateName: 'localhost_cert') |
+ HOST_NAME, 0, untrustedServerContext, backlog: 5) |
.then((server) { |
server.listen((HttpRequest request) { |
request.listen((_) { }, onDone: () { request.response.close(); }); |