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

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

Issue 1420923006: Add unique serial numbers to sample X509 certificates. Remove the "sendClientCertificate" parameter… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Delete all certificate signing private keys, so testers aren't vulnerable. Created 5 years, 1 month 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
« no previous file with comments | « tests/standalone/io/secure_server_client_certificate_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Client for secure_socket_renegotiate_test, that runs in a subprocess. 5 // Client for secure_socket_renegotiate_test, that runs in a subprocess.
6 // The test verifies that client certificates work, if the client and server 6 // The test verifies that client certificates work, if the client and server
7 // are in separate processes, and that connection renegotiation can request 7 // are in separate processes, and that connection renegotiation can request
8 // a client certificate to be sent. 8 // a client certificate to be sent.
9 9
10 import "dart:async"; 10 import "dart:async";
(...skipping 23 matching lines...) Expand all
34 void expect(condition) { 34 void expect(condition) {
35 if (!condition) { 35 if (!condition) {
36 throw new ExpectException(''); 36 throw new ExpectException('');
37 } 37 }
38 } 38 }
39 39
40 40
41 void runClient(int port) { 41 void runClient(int port) {
42 SecureSocket.connect(HOST_NAME, 42 SecureSocket.connect(HOST_NAME,
43 port, 43 port,
44 context: clientContext, 44 context: clientContext)
45 sendClientCertificate: true)
46 .then((SecureSocket socket) { 45 .then((SecureSocket socket) {
47 X509Certificate certificate = socket.peerCertificate; 46 X509Certificate certificate = socket.peerCertificate;
48 expect(certificate != null); 47 expect(certificate != null);
49 expectEquals('CN=localhost', certificate.subject); 48 expectEquals('CN=localhost', certificate.subject);
50 expectEquals('CN=myauthority', certificate.issuer); 49 expectEquals('CN=myauthority', certificate.issuer);
51 StreamIterator<String> input = new StreamIterator(socket 50 StreamIterator<String> input = new StreamIterator(socket
52 .transform(UTF8.decoder) 51 .transform(UTF8.decoder)
53 .transform(new LineSplitter())); 52 .transform(new LineSplitter()));
54 socket.writeln('first'); 53 socket.writeln('first');
55 input.moveNext() 54 input.moveNext()
(...skipping 18 matching lines...) Expand all
74 expect(success != true); 73 expect(success != true);
75 socket.close(); 74 socket.close();
76 }); 75 });
77 }); 76 });
78 } 77 }
79 78
80 79
81 void main(List<String> args) { 80 void main(List<String> args) {
82 runClient(int.parse(args[0])); 81 runClient(int.parse(args[0]));
83 } 82 }
OLDNEW
« no previous file with comments | « tests/standalone/io/secure_server_client_certificate_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698