Index: tests/standalone/io/secure_unauthorized_test.dart |
diff --git a/tests/standalone/io/secure_unauthorized_test.dart b/tests/standalone/io/secure_unauthorized_test.dart |
index 453b8b1bd4bc57c5dca288096c2355fddd116cee..a600d7458f3ab0b1f444217dbc365a4fb1b77972 100644 |
--- a/tests/standalone/io/secure_unauthorized_test.dart |
+++ b/tests/standalone/io/secure_unauthorized_test.dart |
@@ -11,14 +11,15 @@ import "dart:async"; |
import "dart:io"; |
const HOST_NAME = "localhost"; |
-const CERTIFICATE = "localhost_cert"; |
+String localFile(path) => Platform.script.resolve(path).toFilePath(); |
-Future<SecureServerSocket> runServer() { |
- SecureSocket.initialize( |
- database: Platform.script.resolve('pkcert').toFilePath(), |
- password: 'dartdart'); |
+SecurityContext serverContext = new SecurityContext() |
+ ..useCertificateChain(localFile('certificates/untrusted_server_chain.pem')) |
+ ..usePrivateKey(localFile('certificates/untrusted_server_key.pem'), |
+ password: 'dartdart'); |
- return SecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE) |
+Future<SecureServerSocket> runServer() { |
+ return SecureServerSocket.bind(HOST_NAME, 0, serverContext) |
.then((SecureServerSocket server) { |
server.listen((SecureSocket socket) { |
socket.listen((_) { }, |