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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 649413004: net: disable SSLv3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: g cl try Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ssl/ssl_config.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index d900069d7fc0a9896894c5767e51d5f080fb49f6..139b6f3ee270e404ab14d9d93af038a02184c667 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -7078,7 +7078,12 @@ class TestSSLConfigService : public SSLConfigService {
online_rev_checking_(online_rev_checking),
rev_checking_required_local_anchors_(
rev_checking_required_local_anchors),
- fallback_min_version_(0) {}
+ min_version_(kDefaultSSLVersionMin),
+ fallback_min_version_(kDefaultSSLVersionFallbackMin) {}
+
+ void set_min_version(uint16 version) {
+ min_version_ = version;
+ }
void set_fallback_min_version(uint16 version) {
fallback_min_version_ = version;
@@ -7094,6 +7099,9 @@ class TestSSLConfigService : public SSLConfigService {
if (fallback_min_version_) {
config->version_fallback_min = fallback_min_version_;
}
+ if (min_version_) {
+ config->version_min = min_version_;
+ }
}
protected:
@@ -7103,6 +7111,7 @@ class TestSSLConfigService : public SSLConfigService {
const bool ev_enabled_;
const bool online_rev_checking_;
const bool rev_checking_required_local_anchors_;
+ uint16 min_version_;
uint16 fallback_min_version_;
};
@@ -7117,6 +7126,7 @@ class FallbackTestURLRequestContext : public TestURLRequestContext {
false /* online revocation checking */,
false /* require rev. checking for local
anchors */);
+ ssl_config_service->set_min_version(SSL_PROTOCOL_VERSION_SSL3);
ssl_config_service->set_fallback_min_version(version);
set_ssl_config_service(ssl_config_service);
}
@@ -7252,7 +7262,7 @@ TEST_F(HTTPSFallbackTest, SSLv3Fallback) {
SpawnedTestServer::SSLOptions::TLS_INTOLERANT_ALL;
ASSERT_NO_FATAL_FAILURE(DoFallbackTest(ssl_options));
- ExpectFailure(ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION);
+ ExpectFailure(ERR_SSL_VERSION_OR_CIPHER_MISMATCH);
}
// Tests that the SSLv3 fallback works when explicitly enabled.
@@ -7307,6 +7317,7 @@ TEST_F(HTTPSRequestTest, SSLv3FallbackNoCache) {
TestDelegate delegate;
FallbackTestURLRequestContext context(true);
+ context.set_fallback_min_version(SSL_PROTOCOL_VERSION_TLS1);
context.Init();
scoped_ptr<URLRequest> request(context.CreateRequest(
test_server.GetURL(std::string()), DEFAULT_PRIORITY, &delegate, NULL));
« no previous file with comments | « net/ssl/ssl_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698