diff options
author | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-05 11:11:15 +0000 |
---|---|---|
committer | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-05 11:11:15 +0000 |
commit | a6244952c7f13fce9e137e20d27f6700db58ae9f (patch) | |
tree | 316edc923e04ef79ced0309249914f31270c12b1 /net/websockets/websocket_channel.cc | |
parent | e1c913c665472a11722a2e657c54dc3830d85378 (diff) | |
download | chromium_src-a6244952c7f13fce9e137e20d27f6700db58ae9f.zip chromium_src-a6244952c7f13fce9e137e20d27f6700db58ae9f.tar.gz chromium_src-a6244952c7f13fce9e137e20d27f6700db58ae9f.tar.bz2 |
Support recovery from SSL errors.
Previously, the new WebSocket implementation was unable to handle sites
with self-signed certificates and other cases where the user had
overridden certificate errors. Add code to support this case.
This requires adding infrastructure to pass the SSL error back up to the
content layer which knows how to handle it. It also requires that the ID
of the frame be known, so an extra parameter has been added to the
WebSocketHostMsg_AddChannelRequest IPC message.
BUG=364361
Review URL: https://codereview.chromium.org/304093003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets/websocket_channel.cc')
-rw-r--r-- | net/websockets/websocket_channel.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc index 47114f8..c27f8dd 100644 --- a/net/websockets/websocket_channel.cc +++ b/net/websockets/websocket_channel.cc @@ -176,6 +176,15 @@ class WebSocketChannel::ConnectDelegate creator_->OnFinishOpeningHandshake(response.Pass()); } + virtual void OnSSLCertificateError( + scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks> + ssl_error_callbacks, + const SSLInfo& ssl_info, + bool fatal) OVERRIDE { + creator_->OnSSLCertificateError( + ssl_error_callbacks.Pass(), ssl_info, fatal); + } + private: // A pointer to the WebSocketChannel that created this object. There is no // danger of this pointer being stale, because deleting the WebSocketChannel @@ -576,6 +585,14 @@ void WebSocketChannel::OnConnectFailure(const std::string& message) { // |this| has been deleted. } +void WebSocketChannel::OnSSLCertificateError( + scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks> ssl_error_callbacks, + const SSLInfo& ssl_info, + bool fatal) { + AllowUnused(event_interface_->OnSSLCertificateError( + ssl_error_callbacks.Pass(), socket_url_, ssl_info, fatal)); +} + void WebSocketChannel::OnStartOpeningHandshake( scoped_ptr<WebSocketHandshakeRequestInfo> request) { DCHECK(!notification_sender_->handshake_request_info()); |