OLD | NEW |
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 * A high-level class for communicating securely over a TCP socket, using | 8 * A high-level class for communicating securely over a TCP socket, using |
9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an | 9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an |
10 * [IOSink] interface, making it ideal for using together with | 10 * [IOSink] interface, making it ideal for using together with |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 String this.host, | 238 String this.host, |
239 int requestedPort, | 239 int requestedPort, |
240 String this.certificateName, | 240 String this.certificateName, |
241 bool this.is_server, | 241 bool this.is_server, |
242 RawSocket socket, | 242 RawSocket socket, |
243 bool this.requestClientCertificate, | 243 bool this.requestClientCertificate, |
244 bool this.requireClientCertificate, | 244 bool this.requireClientCertificate, |
245 bool this.sendClientCertificate, | 245 bool this.sendClientCertificate, |
246 bool this.onBadCertificate(X509Certificate certificate)) { | 246 bool this.onBadCertificate(X509Certificate certificate)) { |
247 _controller = new StreamController<RawSocketEvent>( | 247 _controller = new StreamController<RawSocketEvent>( |
248 onPauseStateChange: _onPauseStateChange, | 248 onListen: _onSubscriptionStateChange, |
249 onSubscriptionStateChange: _onSubscriptionStateChange); | 249 onPause: _onPauseStateChange, |
| 250 onResume: _onPauseStateChange, |
| 251 onCancel: _onSubscriptionStateChange); |
250 _stream = _controller.stream; | 252 _stream = _controller.stream; |
251 // Throw an ArgumentError if any field is invalid. After this, all | 253 // Throw an ArgumentError if any field is invalid. After this, all |
252 // errors will be reported through the future or the stream. | 254 // errors will be reported through the future or the stream. |
253 _verifyFields(); | 255 _verifyFields(); |
254 _secureFilter.init(); | 256 _secureFilter.init(); |
255 _secureFilter.registerHandshakeCompleteCallback( | 257 _secureFilter.registerHandshakeCompleteCallback( |
256 _secureHandshakeCompleteHandler); | 258 _secureHandshakeCompleteHandler); |
257 if (onBadCertificate != null) { | 259 if (onBadCertificate != null) { |
258 _secureFilter.registerBadCertificateCallback(onBadCertificate); | 260 _secureFilter.registerBadCertificateCallback(onBadCertificate); |
259 } | 261 } |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 void destroy(); | 759 void destroy(); |
758 void handshake(); | 760 void handshake(); |
759 void init(); | 761 void init(); |
760 X509Certificate get peerCertificate; | 762 X509Certificate get peerCertificate; |
761 int processBuffer(int bufferIndex); | 763 int processBuffer(int bufferIndex); |
762 void registerBadCertificateCallback(Function callback); | 764 void registerBadCertificateCallback(Function callback); |
763 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); | 765 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); |
764 | 766 |
765 List<_ExternalBuffer> get buffers; | 767 List<_ExternalBuffer> get buffers; |
766 } | 768 } |
OLD | NEW |