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

Unified Diff: net/socket_stream/socket_stream.cc

Issue 10830256: Check ignore-certificate-erros in SocketStream (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket_stream/socket_stream.cc
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index ce989828a94515cd307d16945d3fa44605901c41..f656cb8b94ab447a84114c8d2f0fe72b1d70ed19 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -29,6 +29,7 @@
#include "net/http/http_network_session.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
+#include "net/http/http_stream_factory.h"
#include "net/http/http_transaction_factory.h"
#include "net/http/http_util.h"
#include "net/socket/client_socket_factory.h"
@@ -1040,7 +1041,7 @@ int SocketStream::DoSSLHandleCertError(int result) {
DCHECK_EQ(STATE_NONE, next_state_);
DCHECK(IsCertificateError(result));
result = HandleCertificateError(result);
- if (result == ERR_IO_PENDING)
+ if (result == OK || result == ERR_IO_PENDING)
next_state_ = STATE_SSL_HANDLE_CERT_ERROR_COMPLETE;
else
next_state_ = STATE_CLOSE;
@@ -1297,12 +1298,16 @@ void SocketStream::DoRestartWithAuth() {
int SocketStream::HandleCertificateError(int result) {
DCHECK(IsCertificateError(result));
+ SSLClientSocket* ssl_socket = static_cast<SSLClientSocket*>(socket_.get());
+ DCHECK(ssl_socket);
+
+ if (HttpStreamFactory::ignore_certificate_errors() &&
+ ssl_socket->IgnoreCertError(result, LOAD_IGNORE_ALL_CERT_ERRORS))
+ return OK;
if (!delegate_)
return result;
- SSLClientSocket* ssl_socket = static_cast<SSLClientSocket*>(socket_.get());
- DCHECK(ssl_socket);
SSLInfo ssl_info;
ssl_socket->GetSSLInfo(&ssl_info);
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698