Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: tests/standalone/io/certificate_test.dart

Issue 18097007: Add SecureSocket.addCertificate. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add documentation link, and some constant trust strings. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/secure_socket.dart ('k') | tests/standalone/io/certificate_test_client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // This test verifies that a server certificate can be verified by a client
6 // that loads the certificate authority certificate it depends on at runtime.
7
8 import "package:path/path.dart";
9 import "dart:io";
10 import "dart:async";
11
12 String scriptDir = dirname(new Options().script);
13
14 void main() {
15 SecureSocket.initialize(database: join(scriptDir, 'pkcert'),
16 password: 'dartdart');
17 runServer().then((SecureServerSocket server) {
18 return Process.run(new Options().executable,
19 ['--checked',
20 join(scriptDir, 'certificate_test_client.dart'),
21 server.port.toString(),
22 join(scriptDir, 'pkcert', 'myauthority.pem')]);
23 }).then((ProcessResult result) {
24 if (result.exitCode != 0) {
25 print("Client failed with exit code ${result.exitCode}");
26 print(" stdout:");
27 print(result.stdout);
28 print(" stderr:");
29 print(result.stderr);
30 throw new AssertionError();
31 }
32 });
33 }
34
35 Future<SecureServerSocket> runServer() =>
36 SecureServerSocket.bind("localhost", 0, "localhost_cert")
37 .then((server) => server..listen(
38 (socket) => socket.pipe(socket).then((_) => server.close())));
OLDNEW
« no previous file with comments | « sdk/lib/io/secure_socket.dart ('k') | tests/standalone/io/certificate_test_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698