OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_request.h" | 5 #include "net/http/http_stream_request.h" |
6 | 6 |
7 #include "base/stl_util-inl.h" | 7 #include "base/stl_util-inl.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
902 const HostPortPair& host_and_port, | 902 const HostPortPair& host_and_port, |
903 bool want_spdy_over_npn) { | 903 bool want_spdy_over_npn) { |
904 | 904 |
905 if (factory_->IsTLSIntolerantServer(request_info().url)) { | 905 if (factory_->IsTLSIntolerantServer(request_info().url)) { |
906 LOG(WARNING) << "Falling back to SSLv3 because host is TLS intolerant: " | 906 LOG(WARNING) << "Falling back to SSLv3 because host is TLS intolerant: " |
907 << GetHostAndPort(request_info().url); | 907 << GetHostAndPort(request_info().url); |
908 ssl_config()->ssl3_fallback = true; | 908 ssl_config()->ssl3_fallback = true; |
909 ssl_config()->tls1_enabled = false; | 909 ssl_config()->tls1_enabled = false; |
910 } | 910 } |
911 | 911 |
912 if (proxy_info()->is_https() && ssl_config()->send_client_cert) { | |
913 // When connecting through an HTTPS proxy, disable TLS False Start so | |
914 // that client authentication errors can be distinguished between those | |
915 // originating from the proxy server (ERR_PROXY_CONNECTION_FAILED) and | |
916 // those originating from the endpoint (ERR_SSL_PROTOCOL_ERROR / | |
917 // ERR_BAD_SSL_CLIENT_AUTH_CERT). | |
918 // TODO(rch): This assumes that the HTTPS proxy will only request a | |
919 // client certificate during the initial handshake. | |
920 // http://crbug.com/FIXME | |
wtc
2011/01/11 23:31:36
Please replace "FIXME" with the bug number.
Is ss
| |
921 ssl_config()->false_start_enabled = false; | |
922 } | |
923 | |
912 UMA_HISTOGRAM_ENUMERATION("Net.ConnectionUsedSSLv3Fallback", | 924 UMA_HISTOGRAM_ENUMERATION("Net.ConnectionUsedSSLv3Fallback", |
913 static_cast<int>(ssl_config()->ssl3_fallback), 2); | 925 static_cast<int>(ssl_config()->ssl3_fallback), 2); |
914 | 926 |
915 int load_flags = request_info().load_flags; | 927 int load_flags = request_info().load_flags; |
916 if (HttpStreamFactory::ignore_certificate_errors()) | 928 if (HttpStreamFactory::ignore_certificate_errors()) |
917 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; | 929 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; |
918 if (request_info().load_flags & LOAD_VERIFY_EV_CERT) | 930 if (request_info().load_flags & LOAD_VERIFY_EV_CERT) |
919 ssl_config()->verify_ev_cert = true; | 931 ssl_config()->verify_ev_cert = true; |
920 | 932 |
921 if (proxy_info()->proxy_server().scheme() == ProxyServer::SCHEME_HTTP || | 933 if (proxy_info()->proxy_server().scheme() == ProxyServer::SCHEME_HTTP || |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
990 // ERR_ADDRESS_UNREACHABLE. | 1002 // ERR_ADDRESS_UNREACHABLE. |
991 return ERR_ADDRESS_UNREACHABLE; | 1003 return ERR_ADDRESS_UNREACHABLE; |
992 default: | 1004 default: |
993 return error; | 1005 return error; |
994 } | 1006 } |
995 | 1007 |
996 if (request_info().load_flags & LOAD_BYPASS_PROXY) { | 1008 if (request_info().load_flags & LOAD_BYPASS_PROXY) { |
997 return error; | 1009 return error; |
998 } | 1010 } |
999 | 1011 |
1012 if (proxy_info()->is_https() && ssl_config_->send_client_cert) { | |
wtc
2011/01/11 23:31:36
Why don't you test for ERR_PROXY_CONNECTION_FAILED
| |
1013 session_->ssl_client_auth_cache()->Remove( | |
1014 proxy_info()->proxy_server().host_port_pair().ToString()); | |
1015 } | |
1016 | |
1000 int rv = session_->proxy_service()->ReconsiderProxyAfterError( | 1017 int rv = session_->proxy_service()->ReconsiderProxyAfterError( |
1001 request_info().url, proxy_info(), &io_callback_, &pac_request_, | 1018 request_info().url, proxy_info(), &io_callback_, &pac_request_, |
1002 net_log_); | 1019 net_log_); |
1003 if (rv == OK || rv == ERR_IO_PENDING) { | 1020 if (rv == OK || rv == ERR_IO_PENDING) { |
1004 // If the error was during connection setup, there is no socket to | 1021 // If the error was during connection setup, there is no socket to |
1005 // disconnect. | 1022 // disconnect. |
1006 if (connection_->socket()) | 1023 if (connection_->socket()) |
1007 connection_->socket()->Disconnect(); | 1024 connection_->socket()->Disconnect(); |
1008 connection_->Reset(); | 1025 connection_->Reset(); |
1009 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; | 1026 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1076 base::TimeDelta::FromMinutes(6), | 1093 base::TimeDelta::FromMinutes(6), |
1077 100); | 1094 100); |
1078 break; | 1095 break; |
1079 default: | 1096 default: |
1080 NOTREACHED(); | 1097 NOTREACHED(); |
1081 break; | 1098 break; |
1082 } | 1099 } |
1083 } | 1100 } |
1084 | 1101 |
1085 } // namespace net | 1102 } // namespace net |
OLD | NEW |