| Index: sdk/lib/io/secure_socket.dart
|
| diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
|
| index 5d894d4d20164df37ce5fb704b17ba62c44e94e0..ddfd5a85dd934a029f967fb4cfdc9c7a69368f94 100644
|
| --- a/sdk/lib/io/secure_socket.dart
|
| +++ b/sdk/lib/io/secure_socket.dart
|
| @@ -21,7 +21,9 @@ abstract class SecureSocket implements Socket {
|
| * client connections, and server certificates to provide on server
|
| * connections. The password argument should be used when creating
|
| * secure server sockets, to allow the private key of the server
|
| - * certificate to be fetched.
|
| + * certificate to be fetched. If useBuiltinRoots is true (the default),
|
| + * then a built-in set of root certificates for trusted certificate
|
| + * authorities is merged with the certificates in the database.
|
| *
|
| * The database should be an NSS certificate database directory
|
| * containing a cert9.db file, not a cert8.db file. This version of
|
| @@ -29,8 +31,9 @@ abstract class SecureSocket implements Socket {
|
| * front of the absolute path of the database directory, or setting the
|
| * environment variable NSS_DEFAULT_DB_TYPE to "sql".
|
| */
|
| - external static void setCertificateDatabase(String certificateDatabase,
|
| - [String password]);
|
| + external static void initialize({String database,
|
| + String password,
|
| + bool useBuiltinRoots: true});
|
| }
|
|
|
|
|
| @@ -298,10 +301,14 @@ class _SecureSocket implements SecureSocket {
|
|
|
| void _secureDataHandler() {
|
| if (_status == HANDSHAKE) {
|
| - _secureHandshake();
|
| + try {
|
| + _secureHandshake();
|
| + } catch (e) { _reportError(e, "SecureSocket error"); }
|
| } else {
|
| - _writeEncryptedData(); // TODO(whesse): Removing this causes a failure.
|
| - _readEncryptedData();
|
| + try {
|
| + _writeEncryptedData(); // TODO(whesse): Removing this causes a failure.
|
| + _readEncryptedData();
|
| + } catch (e) { _reportError(e, "SecureSocket error"); }
|
| if (!_filterReadEmpty) {
|
| // Call the onData event.
|
| if (scheduledDataEvent != null) {
|
| @@ -329,6 +336,7 @@ class _SecureSocket implements SecureSocket {
|
| } else {
|
| e = new SocketIOException('$message (${error.toString()})', null);
|
| }
|
| + close(false);
|
| bool reported = false;
|
| if (_socketErrorHandler != null) {
|
| reported = true;
|
| @@ -340,7 +348,6 @@ class _SecureSocket implements SecureSocket {
|
| if (_outputStream != null) {
|
| reported = reported || _outputStream._onSocketError(e);
|
| }
|
| -
|
| if (!reported) throw e;
|
| }
|
|
|
|
|