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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #endif | 10 #endif |
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 EXPECT_NE(0, d.bytes_received()); | 1788 EXPECT_NE(0, d.bytes_received()); |
1789 EXPECT_EQ(static_cast<int>(SSL_CONNECTION_VERSION_SSL3), | 1789 EXPECT_EQ(static_cast<int>(SSL_CONNECTION_VERSION_SSL3), |
1790 SSLConnectionStatusToVersion(r.ssl_info().connection_status)); | 1790 SSLConnectionStatusToVersion(r.ssl_info().connection_status)); |
1791 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_VERSION_FALLBACK); | 1791 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_VERSION_FALLBACK); |
1792 } | 1792 } |
1793 | 1793 |
1794 // Tests TLSv1.1 -> TLSv1 fallback. Verifies that we don't fall back more | 1794 // Tests TLSv1.1 -> TLSv1 fallback. Verifies that we don't fall back more |
1795 // than necessary. | 1795 // than necessary. |
1796 TEST_F(HTTPSRequestTest, TLSv1Fallback) { | 1796 TEST_F(HTTPSRequestTest, TLSv1Fallback) { |
1797 uint16 default_version_max = SSLConfigService::default_version_max(); | 1797 uint16 default_version_max = SSLConfigService::default_version_max(); |
1798 // The OpenSSL library in use may not support TLS 1.1. | |
1799 #if !defined(USE_OPENSSL) | |
1800 EXPECT_GT(default_version_max, SSL_PROTOCOL_VERSION_TLS1); | |
1801 #endif | |
1802 if (default_version_max <= SSL_PROTOCOL_VERSION_TLS1) | 1798 if (default_version_max <= SSL_PROTOCOL_VERSION_TLS1) |
1803 return; | 1799 return; |
1804 | 1800 |
1805 TestServer::HTTPSOptions https_options( | 1801 TestServer::HTTPSOptions https_options( |
1806 TestServer::HTTPSOptions::CERT_OK); | 1802 TestServer::HTTPSOptions::CERT_OK); |
1807 https_options.tls_intolerant = | 1803 https_options.tls_intolerant = |
1808 TestServer::HTTPSOptions::TLS_INTOLERANT_TLS1_1; | 1804 TestServer::HTTPSOptions::TLS_INTOLERANT_TLS1_1; |
1809 TestServer test_server(https_options, | 1805 TestServer test_server(https_options, |
1810 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 1806 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
1811 ASSERT_TRUE(test_server.Start()); | 1807 ASSERT_TRUE(test_server.Start()); |
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4632 req.SetExtraRequestHeaders(headers); | 4628 req.SetExtraRequestHeaders(headers); |
4633 req.Start(); | 4629 req.Start(); |
4634 MessageLoop::current()->Run(); | 4630 MessageLoop::current()->Run(); |
4635 // If the net tests are being run with ChromeFrame then we need to allow for | 4631 // If the net tests are being run with ChromeFrame then we need to allow for |
4636 // the 'chromeframe' suffix which is added to the user agent before the | 4632 // the 'chromeframe' suffix which is added to the user agent before the |
4637 // closing parentheses. | 4633 // closing parentheses. |
4638 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); | 4634 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); |
4639 } | 4635 } |
4640 | 4636 |
4641 } // namespace net | 4637 } // namespace net |
OLD | NEW |