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 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1817 EXPECT_NE(0, d.bytes_received()); | 1817 EXPECT_NE(0, d.bytes_received()); |
1818 EXPECT_EQ(static_cast<int>(SSL_CONNECTION_VERSION_SSL3), | 1818 EXPECT_EQ(static_cast<int>(SSL_CONNECTION_VERSION_SSL3), |
1819 SSLConnectionStatusToVersion(r.ssl_info().connection_status)); | 1819 SSLConnectionStatusToVersion(r.ssl_info().connection_status)); |
1820 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_VERSION_FALLBACK); | 1820 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_VERSION_FALLBACK); |
1821 } | 1821 } |
1822 | 1822 |
1823 // Tests TLSv1.1 -> TLSv1 fallback. Verifies that we don't fall back more | 1823 // Tests TLSv1.1 -> TLSv1 fallback. Verifies that we don't fall back more |
1824 // than necessary. | 1824 // than necessary. |
1825 TEST_F(HTTPSRequestTest, TLSv1Fallback) { | 1825 TEST_F(HTTPSRequestTest, TLSv1Fallback) { |
1826 uint16 default_version_max = SSLConfigService::default_version_max(); | 1826 uint16 default_version_max = SSLConfigService::default_version_max(); |
1827 // The OpenSSL library in use may not support TLS 1.1. | |
1828 #if !defined(USE_OPENSSL) | |
1829 EXPECT_GT(default_version_max, SSL_PROTOCOL_VERSION_TLS1); | |
1830 #endif | |
1831 if (default_version_max <= SSL_PROTOCOL_VERSION_TLS1) | 1827 if (default_version_max <= SSL_PROTOCOL_VERSION_TLS1) |
1832 return; | 1828 return; |
1833 | 1829 |
1834 TestServer::HTTPSOptions https_options( | 1830 TestServer::HTTPSOptions https_options( |
1835 TestServer::HTTPSOptions::CERT_OK); | 1831 TestServer::HTTPSOptions::CERT_OK); |
1836 https_options.tls_intolerant = | 1832 https_options.tls_intolerant = |
1837 TestServer::HTTPSOptions::TLS_INTOLERANT_TLS1_1; | 1833 TestServer::HTTPSOptions::TLS_INTOLERANT_TLS1_1; |
1838 TestServer test_server(https_options, | 1834 TestServer test_server(https_options, |
1839 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 1835 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
1840 ASSERT_TRUE(test_server.Start()); | 1836 ASSERT_TRUE(test_server.Start()); |
(...skipping 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4696 req.SetExtraRequestHeaders(headers); | 4692 req.SetExtraRequestHeaders(headers); |
4697 req.Start(); | 4693 req.Start(); |
4698 MessageLoop::current()->Run(); | 4694 MessageLoop::current()->Run(); |
4699 // If the net tests are being run with ChromeFrame then we need to allow for | 4695 // If the net tests are being run with ChromeFrame then we need to allow for |
4700 // the 'chromeframe' suffix which is added to the user agent before the | 4696 // the 'chromeframe' suffix which is added to the user agent before the |
4701 // closing parentheses. | 4697 // closing parentheses. |
4702 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); | 4698 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); |
4703 } | 4699 } |
4704 | 4700 |
4705 } // namespace net | 4701 } // namespace net |
OLD | NEW |