| 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 &local_state, base::ThreadTaskRunnerHandle::Get())); | 169 &local_state, base::ThreadTaskRunnerHandle::Get())); |
| 170 ASSERT_TRUE(config_manager.get()); | 170 ASSERT_TRUE(config_manager.get()); |
| 171 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); | 171 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); |
| 172 ASSERT_TRUE(config_service.get()); | 172 ASSERT_TRUE(config_service.get()); |
| 173 | 173 |
| 174 SSLConfig ssl_config; | 174 SSLConfig ssl_config; |
| 175 config_service->GetSSLConfig(&ssl_config); | 175 config_service->GetSSLConfig(&ssl_config); |
| 176 // The command-line option must not have been honored. | 176 // The command-line option must not have been honored. |
| 177 EXPECT_LE(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_min); | 177 EXPECT_LE(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_min); |
| 178 } | 178 } |
| 179 | |
| 180 // Tests that fallback beyond TLS 1.0 cannot be re-enabled. | |
| 181 TEST_F(SSLConfigServiceManagerPrefTest, NoTLS1Fallback) { | |
| 182 scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore()); | |
| 183 | |
| 184 TestingPrefServiceSimple local_state; | |
| 185 local_state.SetUserPref(ssl_config::prefs::kSSLVersionFallbackMin, | |
| 186 new base::StringValue("tls1")); | |
| 187 SSLConfigServiceManager::RegisterPrefs(local_state.registry()); | |
| 188 | |
| 189 std::unique_ptr<SSLConfigServiceManager> config_manager( | |
| 190 SSLConfigServiceManager::CreateDefaultManager( | |
| 191 &local_state, base::ThreadTaskRunnerHandle::Get())); | |
| 192 ASSERT_TRUE(config_manager.get()); | |
| 193 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); | |
| 194 ASSERT_TRUE(config_service.get()); | |
| 195 | |
| 196 SSLConfig ssl_config; | |
| 197 config_service->GetSSLConfig(&ssl_config); | |
| 198 // The command-line option must not have been honored. | |
| 199 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_2, ssl_config.version_fallback_min); | |
| 200 } | |
| OLD | NEW |