OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
907 // We encountered an SSL certificate error. | 907 // We encountered an SSL certificate error. |
908 if (result == ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY || | 908 if (result == ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY || |
909 result == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN) { | 909 result == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN) { |
910 // These are hard failures. They're handled separately and don't have | 910 // These are hard failures. They're handled separately and don't have |
911 // the correct cert status, so set it here. | 911 // the correct cert status, so set it here. |
912 SSLInfo info(transaction_->GetResponseInfo()->ssl_info); | 912 SSLInfo info(transaction_->GetResponseInfo()->ssl_info); |
913 info.cert_status = MapNetErrorToCertStatus(result); | 913 info.cert_status = MapNetErrorToCertStatus(result); |
914 NotifySSLCertificateError(info, true); | 914 NotifySSLCertificateError(info, true); |
915 } else { | 915 } else { |
916 // Maybe overridable, maybe not. Ask the delegate to decide. | 916 // Maybe overridable, maybe not. Ask the delegate to decide. |
917 const URLRequestContext* context = request_->context(); | |
scottmg
2015/02/20 05:14:10
i'm assuming here that request_ won't return a dif
eroman
2015/02/20 07:36:45
Yes that is a safe assumption.
| |
918 TransportSecurityState* state = context->transport_security_state(); | 917 TransportSecurityState* state = context->transport_security_state(); |
919 const bool fatal = | 918 const bool fatal = |
920 state && state->ShouldSSLErrorsBeFatal(request_info_.url.host()); | 919 state && state->ShouldSSLErrorsBeFatal(request_info_.url.host()); |
921 NotifySSLCertificateError( | 920 NotifySSLCertificateError( |
922 transaction_->GetResponseInfo()->ssl_info, fatal); | 921 transaction_->GetResponseInfo()->ssl_info, fatal); |
923 } | 922 } |
924 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { | 923 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { |
925 NotifyCertificateRequested( | 924 NotifyCertificateRequested( |
926 transaction_->GetResponseInfo()->cert_request_info.get()); | 925 transaction_->GetResponseInfo()->cert_request_info.get()); |
927 } else { | 926 } else { |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1499 return override_response_headers_.get() ? | 1498 return override_response_headers_.get() ? |
1500 override_response_headers_.get() : | 1499 override_response_headers_.get() : |
1501 transaction_->GetResponseInfo()->headers.get(); | 1500 transaction_->GetResponseInfo()->headers.get(); |
1502 } | 1501 } |
1503 | 1502 |
1504 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1503 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1505 awaiting_callback_ = false; | 1504 awaiting_callback_ = false; |
1506 } | 1505 } |
1507 | 1506 |
1508 } // namespace net | 1507 } // namespace net |
OLD | NEW |