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

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

Issue 1665433002: Adds SecurityContext.setTrustedCertificatesBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
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";
11 import "dart:convert"; 11 import "dart:convert";
12 import "dart:io"; 12 import "dart:io";
13 13
14 const HOST_NAME = "localhost"; 14 const HOST_NAME = "localhost";
15 String localFile(path) => Platform.script.resolve(path).toFilePath(); 15 String localFile(path) => Platform.script.resolve(path).toFilePath();
16 16
17 SecurityContext clientContext = new SecurityContext() 17 SecurityContext clientContext = new SecurityContext()
18 ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem')); 18 ..setTrustedCertificatesSync(localFile('certificates/trusted_certs.pem'));
19 19
20 class ExpectException implements Exception { 20 class ExpectException implements Exception {
21 ExpectException(this.message); 21 ExpectException(this.message);
22 String toString() => message; 22 String toString() => message;
23 String message; 23 String message;
24 } 24 }
25 25
26 26
27 void expectEquals(expected, actual) { 27 void expectEquals(expected, actual) {
28 if (actual != expected) { 28 if (actual != expected) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 expect(success != true); 73 expect(success != true);
74 socket.close(); 74 socket.close();
75 }); 75 });
76 }); 76 });
77 } 77 }
78 78
79 79
80 void main(List<String> args) { 80 void main(List<String> args) {
81 runClient(int.parse(args[0])); 81 runClient(int.parse(args[0]));
82 } 82 }
OLDNEW
« no previous file with comments | « tests/standalone/io/secure_socket_alpn_test.dart ('k') | tests/standalone/io/secure_socket_renegotiate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698