| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class TLS10SSLConfigService : public SSLConfigService { | 27 class TLS10SSLConfigService : public SSLConfigService { |
| 28 public: | 28 public: |
| 29 TLS10SSLConfigService() { | 29 TLS10SSLConfigService() { |
| 30 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; | 30 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; |
| 31 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1; | 31 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1; |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual void GetSSLConfig(SSLConfig* config) override { | 34 void GetSSLConfig(SSLConfig* config) override { *config = ssl_config_; } |
| 35 *config = ssl_config_; | |
| 36 } | |
| 37 | 35 |
| 38 private: | 36 private: |
| 39 virtual ~TLS10SSLConfigService() {} | 37 ~TLS10SSLConfigService() override {} |
| 40 | 38 |
| 41 SSLConfig ssl_config_; | 39 SSLConfig ssl_config_; |
| 42 }; | 40 }; |
| 43 | 41 |
| 44 class TLS11SSLConfigService : public SSLConfigService { | 42 class TLS11SSLConfigService : public SSLConfigService { |
| 45 public: | 43 public: |
| 46 TLS11SSLConfigService() { | 44 TLS11SSLConfigService() { |
| 47 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; | 45 ssl_config_.version_min = SSL_PROTOCOL_VERSION_SSL3; |
| 48 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1_1; | 46 ssl_config_.version_max = SSL_PROTOCOL_VERSION_TLS1_1; |
| 49 } | 47 } |
| 50 | 48 |
| 51 virtual void GetSSLConfig(SSLConfig* config) override { | 49 void GetSSLConfig(SSLConfig* config) override { *config = ssl_config_; } |
| 52 *config = ssl_config_; | |
| 53 } | |
| 54 | 50 |
| 55 private: | 51 private: |
| 56 virtual ~TLS11SSLConfigService() {} | 52 ~TLS11SSLConfigService() override {} |
| 57 | 53 |
| 58 SSLConfig ssl_config_; | 54 SSLConfig ssl_config_; |
| 59 }; | 55 }; |
| 60 | 56 |
| 61 } // namespace | 57 } // namespace |
| 62 | 58 |
| 63 class HttpNetworkTransactionSSLTest : public testing::Test { | 59 class HttpNetworkTransactionSSLTest : public testing::Test { |
| 64 protected: | 60 protected: |
| 65 virtual void SetUp() { | 61 virtual void SetUp() { |
| 66 ssl_config_service_ = new TLS10SSLConfigService; | 62 ssl_config_service_ = new TLS10SSLConfigService; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 EXPECT_EQ(3u, mock_data.next_index()); | 145 EXPECT_EQ(3u, mock_data.next_index()); |
| 150 | 146 |
| 151 SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); | 147 SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); |
| 152 // |version_max| fallbacks to SSL 3.0. | 148 // |version_max| fallbacks to SSL 3.0. |
| 153 EXPECT_EQ(SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_max); | 149 EXPECT_EQ(SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_max); |
| 154 EXPECT_TRUE(ssl_config.version_fallback); | 150 EXPECT_TRUE(ssl_config.version_fallback); |
| 155 } | 151 } |
| 156 | 152 |
| 157 } // namespace net | 153 } // namespace net |
| 158 | 154 |
| OLD | NEW |