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

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

Issue 1393713003: Remove insecure QUIC support from Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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
« no previous file with comments | « net/http/http_stream_factory_impl.cc ('k') | net/quic/quic_end_to_end_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) 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/http/http_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 if (blocking_job_) 768 if (blocking_job_)
769 next_state_ = STATE_WAIT_FOR_JOB; 769 next_state_ = STATE_WAIT_FOR_JOB;
770 else 770 else
771 next_state_ = STATE_INIT_CONNECTION; 771 next_state_ = STATE_INIT_CONNECTION;
772 return OK; 772 return OK;
773 } 773 }
774 774
775 bool HttpStreamFactoryImpl::Job::ShouldForceQuic() const { 775 bool HttpStreamFactoryImpl::Job::ShouldForceQuic() const {
776 return session_->params().enable_quic && 776 return session_->params().enable_quic &&
777 session_->params().origin_to_force_quic_on.Equals(server_) && 777 session_->params().origin_to_force_quic_on.Equals(server_) &&
778 proxy_info_.is_direct(); 778 proxy_info_.is_direct() && origin_url_.SchemeIs("https");
779 } 779 }
780 780
781 int HttpStreamFactoryImpl::Job::DoWaitForJob() { 781 int HttpStreamFactoryImpl::Job::DoWaitForJob() {
782 DCHECK(blocking_job_); 782 DCHECK(blocking_job_);
783 next_state_ = STATE_WAIT_FOR_JOB_COMPLETE; 783 next_state_ = STATE_WAIT_FOR_JOB_COMPLETE;
784 return ERR_IO_PENDING; 784 return ERR_IO_PENDING;
785 } 785 }
786 786
787 int HttpStreamFactoryImpl::Job::DoWaitForJobComplete(int result) { 787 int HttpStreamFactoryImpl::Job::DoWaitForJobComplete(int result) {
788 DCHECK(!blocking_job_); 788 DCHECK(!blocking_job_);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 } 827 }
828 828
829 if (using_quic_) { 829 if (using_quic_) {
830 if (proxy_info_.is_quic() && !request_info_.url.SchemeIs("http")) { 830 if (proxy_info_.is_quic() && !request_info_.url.SchemeIs("http")) {
831 NOTREACHED(); 831 NOTREACHED();
832 // TODO(rch): support QUIC proxies for HTTPS urls. 832 // TODO(rch): support QUIC proxies for HTTPS urls.
833 return ERR_NOT_IMPLEMENTED; 833 return ERR_NOT_IMPLEMENTED;
834 } 834 }
835 HostPortPair destination; 835 HostPortPair destination;
836 std::string origin_host; 836 std::string origin_host;
837 bool secure_quic;
838 SSLConfig* ssl_config; 837 SSLConfig* ssl_config;
839 if (proxy_info_.is_quic()) { 838 if (proxy_info_.is_quic()) {
840 // A proxy's certificate is expected to be valid for the proxy hostname. 839 // A proxy's certificate is expected to be valid for the proxy hostname.
841 destination = proxy_info_.proxy_server().host_port_pair(); 840 destination = proxy_info_.proxy_server().host_port_pair();
842 origin_host = destination.host(); 841 origin_host = destination.host();
843 secure_quic = true;
844 ssl_config = &proxy_ssl_config_; 842 ssl_config = &proxy_ssl_config_;
845 843
846 // If QUIC is disabled on the destination port, return error. 844 // If QUIC is disabled on the destination port, return error.
847 if (session_->quic_stream_factory()->IsQuicDisabled(destination.port())) 845 if (session_->quic_stream_factory()->IsQuicDisabled(destination.port()))
848 return ERR_QUIC_PROTOCOL_ERROR; 846 return ERR_QUIC_PROTOCOL_ERROR;
849 } else { 847 } else {
848 DCHECK(using_ssl_);
850 // The certificate of a QUIC alternative server is expected to be valid 849 // The certificate of a QUIC alternative server is expected to be valid
851 // for the origin of the request (in addition to being valid for the 850 // for the origin of the request (in addition to being valid for the
852 // server itself). 851 // server itself).
853 destination = server_; 852 destination = server_;
854 origin_host = origin_url_.host(); 853 origin_host = origin_url_.host();
855 secure_quic = using_ssl_;
856 ssl_config = &server_ssl_config_; 854 ssl_config = &server_ssl_config_;
857 } 855 }
858 int rv = quic_request_.Request( 856 int rv =
859 destination, secure_quic, request_info_.privacy_mode, 857 quic_request_.Request(destination, request_info_.privacy_mode,
860 ssl_config->GetCertVerifyFlags(), origin_host, request_info_.method, 858 ssl_config->GetCertVerifyFlags(), origin_host,
861 net_log_, io_callback_); 859 request_info_.method, net_log_, io_callback_);
862 if (rv == OK) { 860 if (rv == OK) {
863 using_existing_quic_session_ = true; 861 using_existing_quic_session_ = true;
864 } else { 862 } else {
865 // OK, there's no available QUIC session. Let |waiting_job_| resume 863 // OK, there's no available QUIC session. Let |waiting_job_| resume
866 // if it's paused. 864 // if it's paused.
867 if (waiting_job_) { 865 if (waiting_job_) {
868 if (rv == ERR_IO_PENDING) { 866 if (rv == ERR_IO_PENDING) {
869 // Start the |waiting_job_| after the delay returned by 867 // Start the |waiting_job_| after the delay returned by
870 // GetTimeDelayForWaitingJob(). 868 // GetTimeDelayForWaitingJob().
871 // 869 //
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 if (connection_->socket()) { 1614 if (connection_->socket()) {
1617 ConnectionAttempts socket_attempts; 1615 ConnectionAttempts socket_attempts;
1618 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1616 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1619 request_->AddConnectionAttempts(socket_attempts); 1617 request_->AddConnectionAttempts(socket_attempts);
1620 } else { 1618 } else {
1621 request_->AddConnectionAttempts(connection_->connection_attempts()); 1619 request_->AddConnectionAttempts(connection_->connection_attempts());
1622 } 1620 }
1623 } 1621 }
1624 1622
1625 } // namespace net 1623 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl.cc ('k') | net/quic/quic_end_to_end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698