OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 * The object containing the certificates to trust when making | 8 * The object containing the certificates to trust when making |
9 * a secure client connection, and the certificate chain and | 9 * a secure client connection, and the certificate chain and |
10 * private key to serve from a secure server. | 10 * private key to serve from a secure server. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 * connection or server connection. The ALPN (application level protocol | 158 * connection or server connection. The ALPN (application level protocol |
159 * negotiation) extension to TLS allows a client to send a list of | 159 * negotiation) extension to TLS allows a client to send a list of |
160 * protocols in the TLS client hello message, and the server to pick | 160 * protocols in the TLS client hello message, and the server to pick |
161 * one and send the selected one back in its server hello message. | 161 * one and send the selected one back in its server hello message. |
162 * | 162 * |
163 * Separate lists of protocols can be sent for client connections and | 163 * Separate lists of protocols can be sent for client connections and |
164 * for server connections, using the same SecurityContext. The [isServer] | 164 * for server connections, using the same SecurityContext. The [isServer] |
165 * boolean argument specifies whether to set the list for server connections | 165 * boolean argument specifies whether to set the list for server connections |
166 * or client connections. | 166 * or client connections. |
167 */ | 167 */ |
168 void setAlpnProtocols(List<String> protocols, bool isServer); | 168 void setAlpnProtocols(List<String> protocols, bool isServer); |
169 | 169 |
170 /// Encodes a set of supported protocols for ALPN/NPN usage. | 170 /// Encodes a set of supported protocols for ALPN/NPN usage. |
171 /// | 171 /// |
172 /// The `protocols` list is expected to contain protocols in descending order | 172 /// The `protocols` list is expected to contain protocols in descending order |
173 /// of preference. | 173 /// of preference. |
174 /// | 174 /// |
175 /// See RFC 7301 (https://tools.ietf.org/html/rfc7301) for the encoding of | 175 /// See RFC 7301 (https://tools.ietf.org/html/rfc7301) for the encoding of |
176 /// `List<String> protocols`: | 176 /// `List<String> protocols`: |
177 /// opaque ProtocolName<1..2^8-1>; | 177 /// opaque ProtocolName<1..2^8-1>; |
178 /// | 178 /// |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 258 } |
259 | 259 |
260 if (bytes.length >= (1 << 13)) { | 260 if (bytes.length >= (1 << 13)) { |
261 throw new ArgumentError( | 261 throw new ArgumentError( |
262 'The maximum message length supported is 2^13-1.'); | 262 'The maximum message length supported is 2^13-1.'); |
263 } | 263 } |
264 | 264 |
265 return new Uint8List.fromList(bytes); | 265 return new Uint8List.fromList(bytes); |
266 } | 266 } |
267 } | 267 } |
OLD | NEW |