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

Side by Side Diff: sdk/lib/io/http.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 | « runtime/bin/secure_socket_unsupported.cc ('k') | sdk/lib/io/security_context.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 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * HTTP status codes. 8 * HTTP status codes.
9 */ 9 */
10 abstract class HttpStatus { 10 abstract class HttpStatus {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 * 93 *
94 * Use [bindSecure] to create an HTTPS server. 94 * Use [bindSecure] to create an HTTPS server.
95 * 95 *
96 * The server presents a certificate to the client. The certificate 96 * The server presents a certificate to the client. The certificate
97 * chain and the private key are set in the [SecurityContext] 97 * chain and the private key are set in the [SecurityContext]
98 * object that is passed to [bindSecure]. 98 * object that is passed to [bindSecure].
99 * 99 *
100 * import 'dart:io'; 100 * import 'dart:io';
101 * import "dart:isolate"; 101 * import "dart:isolate";
102 * 102 *
103 * main() async { 103 * main() {
104 * SecurityContext context = new SecurityContext(); 104 * SecurityContext context = new SecurityContext();
105 * var chain = 105 * var chain =
106 * Platform.script.resolve('certificates/server_chain.pem') 106 * Platform.script.resolve('certificates/server_chain.pem')
107 * .toFilePath(); 107 * .toFilePath();
108 * var key = 108 * var key =
109 * Platform.script.resolve('certificates/server_key.pem') 109 * Platform.script.resolve('certificates/server_key.pem')
110 * .toFilePath(); 110 * .toFilePath();
111 * await context.useCertificateChain(chain); 111 * context.useCertificateChainSync(chain);
112 * await context.usePrivateKey(key, password: 'dartdart'); 112 * context.usePrivateKeySync(key, password: 'dartdart');
113 * 113 *
114 * HttpServer 114 * HttpServer
115 * .bindSecure(InternetAddress.ANY_IP_V6, 115 * .bindSecure(InternetAddress.ANY_IP_V6,
116 * 443, 116 * 443,
117 * context) 117 * context)
118 * .then((server) { 118 * .then((server) {
119 * server.listen((HttpRequest request) { 119 * server.listen((HttpRequest request) {
120 * request.response.write('Hello, world!'); 120 * request.response.write('Hello, world!');
121 * request.response.close(); 121 * request.response.close();
122 * }); 122 * });
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 class RedirectException implements HttpException { 2024 class RedirectException implements HttpException {
2025 final String message; 2025 final String message;
2026 final List<RedirectInfo> redirects; 2026 final List<RedirectInfo> redirects;
2027 2027
2028 const RedirectException(this.message, this.redirects); 2028 const RedirectException(this.message, this.redirects);
2029 2029
2030 String toString() => "RedirectException: $message"; 2030 String toString() => "RedirectException: $message";
2031 2031
2032 Uri get uri => redirects.last.location; 2032 Uri get uri => redirects.last.location;
2033 } 2033 }
OLDNEW
« no previous file with comments | « runtime/bin/secure_socket_unsupported.cc ('k') | sdk/lib/io/security_context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698