OLD | NEW |
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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 // Add the bad certificate to the set of allowed certificates in the | 1067 // Add the bad certificate to the set of allowed certificates in the |
1068 // SSL config object. This data structure will be consulted after calling | 1068 // SSL config object. This data structure will be consulted after calling |
1069 // RestartIgnoringLastError(). And the user will be asked interactively | 1069 // RestartIgnoringLastError(). And the user will be asked interactively |
1070 // before RestartIgnoringLastError() is ever called. | 1070 // before RestartIgnoringLastError() is ever called. |
1071 SSLConfig::CertAndStatus bad_cert; | 1071 SSLConfig::CertAndStatus bad_cert; |
1072 | 1072 |
1073 // |ssl_info_.cert| may be NULL if we failed to create | 1073 // |ssl_info_.cert| may be NULL if we failed to create |
1074 // X509Certificate for whatever reason, but normally it shouldn't | 1074 // X509Certificate for whatever reason, but normally it shouldn't |
1075 // happen, unless this code is used inside sandbox. | 1075 // happen, unless this code is used inside sandbox. |
1076 if (ssl_info_.cert == NULL || | 1076 if (ssl_info_.cert == NULL || |
1077 !ssl_info_.cert->GetDEREncoded(&bad_cert.der_cert)) | 1077 !X509Certificate::GetDEREncoded(ssl_info_.cert->os_cert_handle(), |
| 1078 &bad_cert.der_cert)) { |
1078 return error; | 1079 return error; |
| 1080 } |
1079 bad_cert.cert_status = ssl_info_.cert_status; | 1081 bad_cert.cert_status = ssl_info_.cert_status; |
1080 server_ssl_config_.allowed_bad_certs.push_back(bad_cert); | 1082 server_ssl_config_.allowed_bad_certs.push_back(bad_cert); |
1081 | 1083 |
1082 int load_flags = request_info_.load_flags; | 1084 int load_flags = request_info_.load_flags; |
1083 if (HttpStreamFactory::ignore_certificate_errors()) | 1085 if (HttpStreamFactory::ignore_certificate_errors()) |
1084 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; | 1086 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; |
1085 if (ssl_socket->IgnoreCertError(error, load_flags)) | 1087 if (ssl_socket->IgnoreCertError(error, load_flags)) |
1086 return OK; | 1088 return OK; |
1087 return error; | 1089 return error; |
1088 } | 1090 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 if (IsPreconnecting() || !request_) { | 1144 if (IsPreconnecting() || !request_) { |
1143 return false; | 1145 return false; |
1144 } | 1146 } |
1145 if (using_ssl_) { | 1147 if (using_ssl_) { |
1146 return false; | 1148 return false; |
1147 } | 1149 } |
1148 return request_info_.method == "GET" || request_info_.method == "HEAD"; | 1150 return request_info_.method == "GET" || request_info_.method == "HEAD"; |
1149 } | 1151 } |
1150 | 1152 |
1151 } // namespace net | 1153 } // namespace net |
OLD | NEW |