Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 10218007: net: don't remember TLS intolerant servers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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());
wtc 2012/04/26 00:49:14 Is it easy to check that SSLv3 was used? I guess
agl 2012/04/26 17:03:29 I remembered that we have a connection_status flag
1749 }
1750
1729 // This tests that a load of www.google.com with a certificate error sets 1751 // 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 1752 // the |certificate_errors_are_fatal| flag correctly. This flag will cause
1731 // the interstitial to be fatal. 1753 // the interstitial to be fatal.
1732 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) { 1754 TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) {
1733 TestServer::HTTPSOptions https_options( 1755 TestServer::HTTPSOptions https_options(
1734 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME); 1756 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME);
1735 TestServer test_server(https_options, 1757 TestServer test_server(https_options,
1736 FilePath(FILE_PATH_LITERAL("net/data/ssl"))); 1758 FilePath(FILE_PATH_LITERAL("net/data/ssl")));
1737 ASSERT_TRUE(test_server.Start()); 1759 ASSERT_TRUE(test_server.Start());
1738 1760
(...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after
4557 req.SetExtraRequestHeaders(headers); 4579 req.SetExtraRequestHeaders(headers);
4558 req.Start(); 4580 req.Start();
4559 MessageLoop::current()->Run(); 4581 MessageLoop::current()->Run();
4560 // If the net tests are being run with ChromeFrame then we need to allow for 4582 // 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 4583 // the 'chromeframe' suffix which is added to the user agent before the
4562 // closing parentheses. 4584 // closing parentheses.
4563 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true)); 4585 EXPECT_TRUE(StartsWithASCII(d.data_received(), "Lynx (textmode", true));
4564 } 4586 }
4565 4587
4566 } // namespace net 4588 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698