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

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 6677022: Code cleanup related to allowed_bad_certs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Include cert_status_flags.h Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/socket/ssl_server_socket_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 1081
1082 int HttpStreamFactoryImpl::Job::HandleCertificateError(int error) { 1082 int HttpStreamFactoryImpl::Job::HandleCertificateError(int error) {
1083 DCHECK(using_ssl_); 1083 DCHECK(using_ssl_);
1084 DCHECK(IsCertificateError(error)); 1084 DCHECK(IsCertificateError(error));
1085 1085
1086 SSLClientSocket* ssl_socket = 1086 SSLClientSocket* ssl_socket =
1087 static_cast<SSLClientSocket*>(connection_->socket()); 1087 static_cast<SSLClientSocket*>(connection_->socket());
1088 ssl_socket->GetSSLInfo(&ssl_info_); 1088 ssl_socket->GetSSLInfo(&ssl_info_);
1089 1089
1090 // Add the bad certificate to the set of allowed certificates in the 1090 // Add the bad certificate to the set of allowed certificates in the
1091 // SSL info object. This data structure will be consulted after calling 1091 // SSL config object. This data structure will be consulted after calling
1092 // RestartIgnoringLastError(). And the user will be asked interactively 1092 // RestartIgnoringLastError(). And the user will be asked interactively
1093 // before RestartIgnoringLastError() is ever called. 1093 // before RestartIgnoringLastError() is ever called.
1094 SSLConfig::CertAndStatus bad_cert; 1094 SSLConfig::CertAndStatus bad_cert;
1095 bad_cert.cert = ssl_info_.cert; 1095 bad_cert.cert = ssl_info_.cert;
1096 bad_cert.cert_status = ssl_info_.cert_status; 1096 bad_cert.cert_status = ssl_info_.cert_status;
1097 ssl_config_.allowed_bad_certs.push_back(bad_cert); 1097 ssl_config_.allowed_bad_certs.push_back(bad_cert);
1098 1098
1099 int load_flags = request_info_.load_flags; 1099 int load_flags = request_info_.load_flags;
1100 if (HttpStreamFactory::ignore_certificate_errors()) 1100 if (HttpStreamFactory::ignore_certificate_errors())
1101 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; 1101 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const { 1146 bool HttpStreamFactoryImpl::Job::IsPreconnecting() const {
1147 DCHECK_GE(num_streams_, 0); 1147 DCHECK_GE(num_streams_, 0);
1148 return num_streams_ > 0; 1148 return num_streams_ > 0;
1149 } 1149 }
1150 1150
1151 bool HttpStreamFactoryImpl::Job::IsOrphaned() const { 1151 bool HttpStreamFactoryImpl::Job::IsOrphaned() const {
1152 return !IsPreconnecting() && !request_; 1152 return !IsPreconnecting() && !request_;
1153 } 1153 }
1154 1154
1155 } // namespace net 1155 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/socket/ssl_server_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698