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/quic/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 | 482 |
483 bool QuicClientSession::CanPool(const std::string& hostname) const { | 483 bool QuicClientSession::CanPool(const std::string& hostname) const { |
484 DCHECK(connection()->connected()); | 484 DCHECK(connection()->connected()); |
485 SSLInfo ssl_info; | 485 SSLInfo ssl_info; |
486 if (!GetSSLInfo(&ssl_info) || !ssl_info.cert) { | 486 if (!GetSSLInfo(&ssl_info) || !ssl_info.cert) { |
487 // We can always pool with insecure QUIC sessions. | 487 // We can always pool with insecure QUIC sessions. |
488 return true; | 488 return true; |
489 } | 489 } |
490 | 490 |
491 bool unused = false; | 491 bool unused = false; |
492 // Pooling is prohibited for connections on which client certs were | 492 // Pooling is prohibited if the server cert is not valid for the new domain, |
493 // sent. It is also prohibited for when channel ID was sent if the | 493 // and for connections on which client certs were sent. It is also prohibited |
494 // hosts are from different eTLDs. And of course, it is prohibited | 494 // when channel ID was sent if the hosts are from different eTLDs+1. |
495 // if the server cert is not valid for the new domain. | |
496 if (!ssl_info.cert->VerifyNameMatch(hostname, &unused)) | 495 if (!ssl_info.cert->VerifyNameMatch(hostname, &unused)) |
497 return false; | 496 return false; |
498 | 497 |
499 if (ssl_info.client_cert_sent) | 498 if (ssl_info.client_cert_sent) |
500 return false; | 499 return false; |
501 | 500 |
502 if (ssl_info.channel_id_sent && | 501 if (ssl_info.channel_id_sent && |
503 ServerBoundCertService::GetDomainForHost(hostname) != | 502 ServerBoundCertService::GetDomainForHost(hostname) != |
504 ServerBoundCertService::GetDomainForHost(server_host_port_.host())) { | 503 ServerBoundCertService::GetDomainForHost(server_host_port_.host())) { |
505 return false; | 504 return false; |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 return; | 850 return; |
852 | 851 |
853 // TODO(rch): re-enable this code once beta is cut. | 852 // TODO(rch): re-enable this code once beta is cut. |
854 // if (stream_factory_) | 853 // if (stream_factory_) |
855 // stream_factory_->OnSessionConnectTimeout(this); | 854 // stream_factory_->OnSessionConnectTimeout(this); |
856 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); | 855 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); |
857 // DCHECK_EQ(0u, GetNumOpenStreams()); | 856 // DCHECK_EQ(0u, GetNumOpenStreams()); |
858 } | 857 } |
859 | 858 |
860 } // namespace net | 859 } // namespace net |
OLD | NEW |