| Index: tests/standalone/io/secure_server_client_certificate_test.dart
|
| diff --git a/tests/standalone/io/secure_server_test.dart b/tests/standalone/io/secure_server_client_certificate_test.dart
|
| similarity index 83%
|
| copy from tests/standalone/io/secure_server_test.dart
|
| copy to tests/standalone/io/secure_server_client_certificate_test.dart
|
| index 89415483b9542d8d49b105715aacb69944818f6f..261c716f2129c3ffb8915e0c7e96b8deb541a6b4 100644
|
| --- a/tests/standalone/io/secure_server_test.dart
|
| +++ b/tests/standalone/io/secure_server_client_certificate_test.dart
|
| @@ -26,6 +26,8 @@ class SecureTestServer {
|
| void onConnection(Socket connection) {
|
| connection.onConnect = () {
|
| numConnections++;
|
| + var certificate = connection.peerCertificate;
|
| + Expect.isTrue(certificate.subject.contains("CN="));
|
| };
|
| String received = "";
|
| connection.onData = () {
|
| @@ -43,7 +45,11 @@ class SecureTestServer {
|
| }
|
|
|
| int start() {
|
| - server = new SecureServerSocket(SERVER_ADDRESS, 0, 10, "CN=$HOST_NAME");
|
| + server = new SecureServerSocket(SERVER_ADDRESS,
|
| + 0,
|
| + 10,
|
| + "CN=$HOST_NAME",
|
| + requireClientCertificate: true);
|
| Expect.isNotNull(server);
|
| server.onConnection = onConnection;
|
| server.onError = errorHandlerServer;
|
| @@ -60,7 +66,7 @@ class SecureTestServer {
|
|
|
| class SecureTestClient {
|
| SecureTestClient(int this.port, String this.name) {
|
| - socket = new SecureSocket(HOST_NAME, port);
|
| + socket = new SecureSocket(HOST_NAME, port, sendClientCertificate: true);
|
| socket.onConnect = this.onConnect;
|
| socket.onData = () {
|
| reply = reply.concat(new String.fromCharCodes(socket.read()));
|
| @@ -101,7 +107,8 @@ void main() {
|
| Path scriptDir = new Path.fromNative(new Options().script).directoryPath;
|
| Path certificateDatabase = scriptDir.append('pkcert');
|
| SecureSocket.initialize(database: certificateDatabase.toNativePath(),
|
| - password: 'dartdart');
|
| + password: 'dartdart',
|
| + useBuiltinRoots: false);
|
|
|
| var server = new SecureTestServer();
|
| int port = server.start();
|
|
|