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 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1719 CertStatus cert_status; | 1719 CertStatus cert_status; |
1720 DoConnection(https_options, &cert_status); | 1720 DoConnection(https_options, &cert_status); |
1721 | 1721 |
1722 // If we're not trying EV verification then, even if the CRLSet has expired, | 1722 // If we're not trying EV verification then, even if the CRLSet has expired, |
1723 // we don't fall back to online revocation checks. | 1723 // we don't fall back to online revocation checks. |
1724 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS); | 1724 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS); |
1725 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); | 1725 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); |
1726 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); | 1726 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); |
1727 } | 1727 } |
1728 | 1728 |
| 1729 TEST_F(HTTPSRequestTest, SSLv3Fallback) { |
| 1730 TestServer::HTTPSOptions https_options( |
| 1731 TestServer::HTTPSOptions::CERT_OK); |
| 1732 https_options.tls_intolerant = true; |
| 1733 TestServer test_server(https_options, |
| 1734 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
| 1735 ASSERT_TRUE(test_server.Start()); |
| 1736 |
| 1737 TestDelegate d; |
| 1738 scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext(true)); |
| 1739 context->Init(); |
| 1740 d.set_allow_certificate_errors(true); |
| 1741 URLRequest r(test_server.GetURL(""), &d); |
| 1742 r.set_context(context.get()); |
| 1743 r.Start(); |
| 1744 |
| 1745 MessageLoop::current()->Run(); |
| 1746 |
| 1747 EXPECT_EQ(1, d.response_started_count()); |
| 1748 EXPECT_NE(0, d.bytes_received()); |
| 1749 EXPECT_TRUE(r.ssl_info().connection_status & SSL_CONNECTION_SSL3_FALLBACK); |
| 1750 } |
| 1751 |
1729 // This tests that a load of www.google.com with a certificate error sets | 1752 // This tests that a load of www.google.com with a certificate error sets |
1730 // the |certificate_errors_are_fatal| flag correctly. This flag will cause | 1753 // the |certificate_errors_are_fatal| flag correctly. This flag will cause |
1731 // the interstitial to be fatal. | 1754 // the interstitial to be fatal. |
1732 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { | 1755 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { |
1733 TestServer::HTTPSOptions https_options( | 1756 TestServer::HTTPSOptions https_options( |
1734 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME); | 1757 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME); |
1735 TestServer test_server(https_options, | 1758 TestServer test_server(https_options, |
1736 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 1759 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
1737 ASSERT_TRUE(test_server.Start()); | 1760 ASSERT_TRUE(test_server.Start()); |
1738 | 1761 |
(...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4557 req.SetExtraRequestHeaders(headers); | 4580 req.SetExtraRequestHeaders(headers); |
4558 req.Start(); | 4581 req.Start(); |
4559 MessageLoop::current()->Run(); | 4582 MessageLoop::current()->Run(); |
4560 // If the net tests are being run with ChromeFrame then we need to allow for | 4583 // If the net tests are being run with ChromeFrame then we need to allow for |
4561 // the 'chromeframe' suffix which is added to the user agent before the | 4584 // the 'chromeframe' suffix which is added to the user agent before the |
4562 // closing parentheses. | 4585 // closing parentheses. |
4563 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); | 4586 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); |
4564 } | 4587 } |
4565 | 4588 |
4566 } // namespace net | 4589 } // namespace net |
OLD | NEW |