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

Side by Side Diff: tests/standalone/io/http_proxy_advanced_test.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
« no previous file with comments | « sdk/lib/io/security_context.dart ('k') | tests/standalone/io/http_proxy_test.dart » ('j') | 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 import "package:crypto/crypto.dart"; 5 import "package:crypto/crypto.dart";
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import "package:path/path.dart"; 7 import "package:path/path.dart";
8 import "dart:async"; 8 import "dart:async";
9 import "dart:io"; 9 import "dart:io";
10 import 'dart:convert'; 10 import 'dart:convert';
11 11
12 String localFile(path) => Platform.script.resolve(path).toFilePath(); 12 String localFile(path) => Platform.script.resolve(path).toFilePath();
13 List<int> readLocalFile(path) => (new File(localFile(path))).readAsBytesSync();
14 13
15 SecurityContext serverContext = new SecurityContext() 14 SecurityContext serverContext = new SecurityContext()
16 ..useCertificateChainBytes(readLocalFile('certificates/server_chain.pem')) 15 ..useCertificateChainSync(localFile('certificates/server_chain.pem'))
17 ..usePrivateKeyBytes(readLocalFile('certificates/server_key.pem'), 16 ..usePrivateKeySync(localFile('certificates/server_key.pem'),
18 password: 'dartdart'); 17 password: 'dartdart');
19 18
20 SecurityContext clientContext = new SecurityContext() 19 SecurityContext clientContext = new SecurityContext()
21 ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem')); 20 ..setTrustedCertificatesSync(localFile('certificates/trusted_certs.pem'));
22 21
23 class Server { 22 class Server {
24 HttpServer server; 23 HttpServer server;
25 bool secure; 24 bool secure;
26 int proxyHops; 25 int proxyHops;
27 List<String> directRequestPaths; 26 List<String> directRequestPaths;
28 int requestCount = 0; 27 int requestCount = 0;
29 28
30 Server(this.proxyHops, this.directRequestPaths, this.secure); 29 Server(this.proxyHops, this.directRequestPaths, this.secure);
31 30
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 // The two invocations use the same global variable for state - 627 // The two invocations use the same global variable for state -
629 // run one after the other. 628 // run one after the other.
630 testProxyAuthenticate(false) 629 testProxyAuthenticate(false)
631 .then((_) => testProxyAuthenticate(true)); 630 .then((_) => testProxyAuthenticate(true));
632 631
633 // This test is not normally run. It can be used for locally testing 632 // This test is not normally run. It can be used for locally testing
634 // with a real proxy server (e.g. Apache). 633 // with a real proxy server (e.g. Apache).
635 // testRealProxy(); 634 // testRealProxy();
636 // testRealProxyAuth(); 635 // testRealProxyAuth();
637 } 636 }
OLDNEW
« no previous file with comments | « sdk/lib/io/security_context.dart ('k') | tests/standalone/io/http_proxy_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698