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 |
11 | 11 |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
14 #include <algorithm> | 14 #include <algorithm> |
15 | 15 |
| 16 #include "base/base64.h" |
16 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
17 #include "base/bind.h" | 18 #include "base/bind.h" |
18 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
19 #include "base/files/file_path.h" | 20 #include "base/files/file_path.h" |
20 #include "base/files/file_util.h" | 21 #include "base/files/file_util.h" |
21 #include "base/files/scoped_temp_dir.h" | 22 #include "base/files/scoped_temp_dir.h" |
22 #include "base/format_macros.h" | 23 #include "base/format_macros.h" |
23 #include "base/json/json_reader.h" | 24 #include "base/json/json_reader.h" |
24 #include "base/location.h" | 25 #include "base/location.h" |
25 #include "base/memory/scoped_ptr.h" | 26 #include "base/memory/scoped_ptr.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "net/http/http_network_session.h" | 69 #include "net/http/http_network_session.h" |
69 #include "net/http/http_request_headers.h" | 70 #include "net/http/http_request_headers.h" |
70 #include "net/http/http_response_headers.h" | 71 #include "net/http/http_response_headers.h" |
71 #include "net/http/http_util.h" | 72 #include "net/http/http_util.h" |
72 #include "net/log/net_log.h" | 73 #include "net/log/net_log.h" |
73 #include "net/log/test_net_log.h" | 74 #include "net/log/test_net_log.h" |
74 #include "net/log/test_net_log_entry.h" | 75 #include "net/log/test_net_log_entry.h" |
75 #include "net/log/test_net_log_util.h" | 76 #include "net/log/test_net_log_util.h" |
76 #include "net/proxy/proxy_service.h" | 77 #include "net/proxy/proxy_service.h" |
77 #include "net/socket/ssl_client_socket.h" | 78 #include "net/socket/ssl_client_socket.h" |
| 79 #include "net/ssl/channel_id_service.h" |
| 80 #include "net/ssl/default_channel_id_store.h" |
78 #include "net/ssl/ssl_cipher_suite_names.h" | 81 #include "net/ssl/ssl_cipher_suite_names.h" |
79 #include "net/ssl/ssl_connection_status_flags.h" | 82 #include "net/ssl/ssl_connection_status_flags.h" |
| 83 #include "net/ssl/token_binding.h" |
80 #include "net/test/cert_test_util.h" | 84 #include "net/test/cert_test_util.h" |
81 #include "net/test/embedded_test_server/embedded_test_server.h" | 85 #include "net/test/embedded_test_server/embedded_test_server.h" |
82 #include "net/test/embedded_test_server/http_request.h" | 86 #include "net/test/embedded_test_server/http_request.h" |
83 #include "net/test/embedded_test_server/http_response.h" | 87 #include "net/test/embedded_test_server/http_response.h" |
84 #include "net/test/spawned_test_server/spawned_test_server.h" | 88 #include "net/test/spawned_test_server/spawned_test_server.h" |
85 #include "net/test/url_request/url_request_failed_job.h" | 89 #include "net/test/url_request/url_request_failed_job.h" |
86 #include "net/url_request/data_protocol_handler.h" | 90 #include "net/url_request/data_protocol_handler.h" |
87 #include "net/url_request/static_http_user_agent_settings.h" | 91 #include "net/url_request/static_http_user_agent_settings.h" |
88 #include "net/url_request/url_request.h" | 92 #include "net/url_request/url_request.h" |
89 #include "net/url_request/url_request_filter.h" | 93 #include "net/url_request/url_request_filter.h" |
(...skipping 3188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3278 } | 3282 } |
3279 | 3283 |
3280 LocalHttpTestServer* test_server() { | 3284 LocalHttpTestServer* test_server() { |
3281 return &test_server_; | 3285 return &test_server_; |
3282 } | 3286 } |
3283 | 3287 |
3284 protected: | 3288 protected: |
3285 LocalHttpTestServer test_server_; | 3289 LocalHttpTestServer test_server_; |
3286 }; | 3290 }; |
3287 | 3291 |
| 3292 class TestSSLConfigService : public SSLConfigService { |
| 3293 public: |
| 3294 TestSSLConfigService(bool ev_enabled, |
| 3295 bool online_rev_checking, |
| 3296 bool rev_checking_required_local_anchors, |
| 3297 bool token_binding_enabled) |
| 3298 : ev_enabled_(ev_enabled), |
| 3299 online_rev_checking_(online_rev_checking), |
| 3300 rev_checking_required_local_anchors_( |
| 3301 rev_checking_required_local_anchors), |
| 3302 min_version_(kDefaultSSLVersionMin), |
| 3303 fallback_min_version_(kDefaultSSLVersionFallbackMin), |
| 3304 token_binding_enabled_(token_binding_enabled) {} |
| 3305 |
| 3306 void set_min_version(uint16 version) { min_version_ = version; } |
| 3307 |
| 3308 void set_fallback_min_version(uint16 version) { |
| 3309 fallback_min_version_ = version; |
| 3310 } |
| 3311 |
| 3312 // SSLConfigService: |
| 3313 void GetSSLConfig(SSLConfig* config) override { |
| 3314 *config = SSLConfig(); |
| 3315 config->rev_checking_enabled = online_rev_checking_; |
| 3316 config->verify_ev_cert = ev_enabled_; |
| 3317 config->rev_checking_required_local_anchors = |
| 3318 rev_checking_required_local_anchors_; |
| 3319 if (fallback_min_version_) { |
| 3320 config->version_fallback_min = fallback_min_version_; |
| 3321 } |
| 3322 if (min_version_) { |
| 3323 config->version_min = min_version_; |
| 3324 } |
| 3325 if (token_binding_enabled_) { |
| 3326 config->token_binding_params.push_back(TB_PARAM_ECDSAP256); |
| 3327 } |
| 3328 } |
| 3329 |
| 3330 protected: |
| 3331 ~TestSSLConfigService() override {} |
| 3332 |
| 3333 private: |
| 3334 const bool ev_enabled_; |
| 3335 const bool online_rev_checking_; |
| 3336 const bool rev_checking_required_local_anchors_; |
| 3337 uint16 min_version_; |
| 3338 uint16 fallback_min_version_; |
| 3339 const bool token_binding_enabled_; |
| 3340 }; |
| 3341 |
| 3342 class TokenBindingURLRequestTest : public URLRequestTestHTTP { |
| 3343 public: |
| 3344 void SetUp() override { |
| 3345 default_context_.set_ssl_config_service( |
| 3346 new TestSSLConfigService(false, false, false, true)); |
| 3347 channel_id_service_.reset(new ChannelIDService( |
| 3348 new DefaultChannelIDStore(NULL), base::ThreadTaskRunnerHandle::Get())); |
| 3349 default_context_.set_channel_id_service(channel_id_service_.get()); |
| 3350 URLRequestTestHTTP::SetUp(); |
| 3351 } |
| 3352 |
| 3353 protected: |
| 3354 scoped_ptr<ChannelIDService> channel_id_service_; |
| 3355 }; |
| 3356 |
| 3357 TEST_F(TokenBindingURLRequestTest, TokenBindingTest) { |
| 3358 SpawnedTestServer::SSLOptions ssl_options; |
| 3359 ssl_options.supported_token_binding_params.push_back(TB_PARAM_ECDSAP256); |
| 3360 SpawnedTestServer https_test_server(SpawnedTestServer::TYPE_HTTPS, |
| 3361 ssl_options, |
| 3362 base::FilePath(kTestFilePath)); |
| 3363 ASSERT_TRUE(https_test_server.Start()); |
| 3364 |
| 3365 TestDelegate d; |
| 3366 { |
| 3367 scoped_ptr<URLRequest> r(default_context_.CreateRequest( |
| 3368 https_test_server.GetURL("tokbind-ekm"), DEFAULT_PRIORITY, &d)); |
| 3369 r->Start(); |
| 3370 EXPECT_TRUE(r->is_pending()); |
| 3371 |
| 3372 base::RunLoop().Run(); |
| 3373 |
| 3374 EXPECT_EQ(URLRequestStatus::SUCCESS, r->status().status()); |
| 3375 |
| 3376 HttpRequestHeaders headers; |
| 3377 std::string token_binding_header, token_binding_message; |
| 3378 EXPECT_TRUE(r->GetFullRequestHeaders(&headers)); |
| 3379 EXPECT_TRUE(headers.GetHeader(HttpRequestHeaders::kTokenBinding, |
| 3380 &token_binding_header)); |
| 3381 base::ReplaceChars(token_binding_header, "_", "/", &token_binding_header); |
| 3382 base::ReplaceChars(token_binding_header, "-", "+", &token_binding_header); |
| 3383 EXPECT_TRUE( |
| 3384 base::Base64Decode(token_binding_header, &token_binding_message)); |
| 3385 std::string ec_point, signature; |
| 3386 EXPECT_TRUE( |
| 3387 ParseTokenBindingMessage(token_binding_message, &ec_point, &signature)); |
| 3388 |
| 3389 EXPECT_GT(d.bytes_received(), 0); |
| 3390 std::string ekm = d.data_received(); |
| 3391 |
| 3392 EXPECT_TRUE(VerifyEKMSignature(ec_point, signature, ekm)); |
| 3393 } |
| 3394 } |
| 3395 |
3288 // In this unit test, we're using the HTTPTestServer as a proxy server and | 3396 // In this unit test, we're using the HTTPTestServer as a proxy server and |
3289 // issuing a CONNECT request with the magic host name "www.redirect.com". | 3397 // issuing a CONNECT request with the magic host name "www.redirect.com". |
3290 // The HTTPTestServer will return a 302 response, which we should not | 3398 // The HTTPTestServer will return a 302 response, which we should not |
3291 // follow. | 3399 // follow. |
3292 TEST_F(URLRequestTestHTTP, ProxyTunnelRedirectTest) { | 3400 TEST_F(URLRequestTestHTTP, ProxyTunnelRedirectTest) { |
3293 ASSERT_TRUE(test_server_.Start()); | 3401 ASSERT_TRUE(test_server_.Start()); |
3294 | 3402 |
3295 TestNetworkDelegate network_delegate; // Must outlive URLRequest. | 3403 TestNetworkDelegate network_delegate; // Must outlive URLRequest. |
3296 TestURLRequestContextWithProxy context( | 3404 TestURLRequestContextWithProxy context( |
3297 test_server_.host_port_pair().ToString(), &network_delegate); | 3405 test_server_.host_port_pair().ToString(), &network_delegate); |
(...skipping 5116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8414 for (size_t i = 0; i < lines.size(); i++) { | 8522 for (size_t i = 0; i < lines.size(); i++) { |
8415 int cipher_suite; | 8523 int cipher_suite; |
8416 ASSERT_TRUE(base::StringToInt(lines[i], &cipher_suite)); | 8524 ASSERT_TRUE(base::StringToInt(lines[i], &cipher_suite)); |
8417 EXPECT_FALSE(IsECDSACipherSuite(cipher_suite)) | 8525 EXPECT_FALSE(IsECDSACipherSuite(cipher_suite)) |
8418 << "ClientHello advertised " << cipher_suite; | 8526 << "ClientHello advertised " << cipher_suite; |
8419 } | 8527 } |
8420 } | 8528 } |
8421 | 8529 |
8422 #endif // OS_WIN | 8530 #endif // OS_WIN |
8423 | 8531 |
8424 class TestSSLConfigService : public SSLConfigService { | |
8425 public: | |
8426 TestSSLConfigService(bool ev_enabled, | |
8427 bool online_rev_checking, | |
8428 bool rev_checking_required_local_anchors) | |
8429 : ev_enabled_(ev_enabled), | |
8430 online_rev_checking_(online_rev_checking), | |
8431 rev_checking_required_local_anchors_( | |
8432 rev_checking_required_local_anchors), | |
8433 min_version_(kDefaultSSLVersionMin), | |
8434 fallback_min_version_(kDefaultSSLVersionFallbackMin) {} | |
8435 | |
8436 void set_min_version(uint16 version) { | |
8437 min_version_ = version; | |
8438 } | |
8439 | |
8440 void set_fallback_min_version(uint16 version) { | |
8441 fallback_min_version_ = version; | |
8442 } | |
8443 | |
8444 // SSLConfigService: | |
8445 void GetSSLConfig(SSLConfig* config) override { | |
8446 *config = SSLConfig(); | |
8447 config->rev_checking_enabled = online_rev_checking_; | |
8448 config->verify_ev_cert = ev_enabled_; | |
8449 config->rev_checking_required_local_anchors = | |
8450 rev_checking_required_local_anchors_; | |
8451 if (fallback_min_version_) { | |
8452 config->version_fallback_min = fallback_min_version_; | |
8453 } | |
8454 if (min_version_) { | |
8455 config->version_min = min_version_; | |
8456 } | |
8457 } | |
8458 | |
8459 protected: | |
8460 ~TestSSLConfigService() override {} | |
8461 | |
8462 private: | |
8463 const bool ev_enabled_; | |
8464 const bool online_rev_checking_; | |
8465 const bool rev_checking_required_local_anchors_; | |
8466 uint16 min_version_; | |
8467 uint16 fallback_min_version_; | |
8468 }; | |
8469 | |
8470 class FallbackTestURLRequestContext : public TestURLRequestContext { | 8532 class FallbackTestURLRequestContext : public TestURLRequestContext { |
8471 public: | 8533 public: |
8472 explicit FallbackTestURLRequestContext(bool delay_initialization) | 8534 explicit FallbackTestURLRequestContext(bool delay_initialization) |
8473 : TestURLRequestContext(delay_initialization) {} | 8535 : TestURLRequestContext(delay_initialization) {} |
8474 | 8536 |
8475 void set_fallback_min_version(uint16 version) { | 8537 void set_fallback_min_version(uint16 version) { |
8476 TestSSLConfigService *ssl_config_service = | 8538 TestSSLConfigService* ssl_config_service = new TestSSLConfigService( |
8477 new TestSSLConfigService(true /* check for EV */, | 8539 true /* check for EV */, false /* online revocation checking */, |
8478 false /* online revocation checking */, | 8540 false /* require rev. checking for local |
8479 false /* require rev. checking for local | 8541 anchors */, |
8480 anchors */); | 8542 false /* token binding enabled */); |
8481 ssl_config_service->set_fallback_min_version(version); | 8543 ssl_config_service->set_fallback_min_version(version); |
8482 set_ssl_config_service(ssl_config_service); | 8544 set_ssl_config_service(ssl_config_service); |
8483 } | 8545 } |
8484 }; | 8546 }; |
8485 | 8547 |
8486 class HTTPSFallbackTest : public testing::Test { | 8548 class HTTPSFallbackTest : public testing::Test { |
8487 public: | 8549 public: |
8488 HTTPSFallbackTest() : context_(true) {} | 8550 HTTPSFallbackTest() : context_(true) {} |
8489 ~HTTPSFallbackTest() override {} | 8551 ~HTTPSFallbackTest() override {} |
8490 | 8552 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8845 #if defined(USE_NSS_CERTS) || defined(OS_IOS) | 8907 #if defined(USE_NSS_CERTS) || defined(OS_IOS) |
8846 ShutdownNSSHttpIO(); | 8908 ShutdownNSSHttpIO(); |
8847 #endif | 8909 #endif |
8848 } | 8910 } |
8849 | 8911 |
8850 protected: | 8912 protected: |
8851 // SetupContext configures the URLRequestContext that will be used for making | 8913 // SetupContext configures the URLRequestContext that will be used for making |
8852 // connetions to testserver. This can be overridden in test subclasses for | 8914 // connetions to testserver. This can be overridden in test subclasses for |
8853 // different behaviour. | 8915 // different behaviour. |
8854 virtual void SetupContext(URLRequestContext* context) { | 8916 virtual void SetupContext(URLRequestContext* context) { |
8855 context->set_ssl_config_service( | 8917 context->set_ssl_config_service(new TestSSLConfigService( |
8856 new TestSSLConfigService(true /* check for EV */, | 8918 true /* check for EV */, true /* online revocation checking */, |
8857 true /* online revocation checking */, | 8919 false /* require rev. checking for local |
8858 false /* require rev. checking for local | 8920 anchors */, |
8859 anchors */)); | 8921 false /* token binding enabled */)); |
8860 } | 8922 } |
8861 | 8923 |
8862 scoped_ptr<ScopedTestRoot> test_root_; | 8924 scoped_ptr<ScopedTestRoot> test_root_; |
8863 TestURLRequestContext context_; | 8925 TestURLRequestContext context_; |
8864 scoped_ptr<ScopedTestEVPolicy> ev_test_policy_; | 8926 scoped_ptr<ScopedTestEVPolicy> ev_test_policy_; |
8865 }; | 8927 }; |
8866 | 8928 |
8867 static CertStatus ExpectedCertStatusForFailedOnlineRevocationCheck() { | 8929 static CertStatus ExpectedCertStatusForFailedOnlineRevocationCheck() { |
8868 #if defined(OS_WIN) | 8930 #if defined(OS_WIN) |
8869 // Windows can return CERT_STATUS_UNABLE_TO_CHECK_REVOCATION but we don't | 8931 // Windows can return CERT_STATUS_UNABLE_TO_CHECK_REVOCATION but we don't |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9040 DoConnection(ssl_options, &cert_status); | 9102 DoConnection(ssl_options, &cert_status); |
9041 | 9103 |
9042 EXPECT_EQ(CERT_STATUS_REVOKED, cert_status & CERT_STATUS_ALL_ERRORS); | 9104 EXPECT_EQ(CERT_STATUS_REVOKED, cert_status & CERT_STATUS_ALL_ERRORS); |
9043 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); | 9105 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); |
9044 EXPECT_TRUE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); | 9106 EXPECT_TRUE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); |
9045 } | 9107 } |
9046 | 9108 |
9047 class HTTPSHardFailTest : public HTTPSOCSPTest { | 9109 class HTTPSHardFailTest : public HTTPSOCSPTest { |
9048 protected: | 9110 protected: |
9049 void SetupContext(URLRequestContext* context) override { | 9111 void SetupContext(URLRequestContext* context) override { |
9050 context->set_ssl_config_service( | 9112 context->set_ssl_config_service(new TestSSLConfigService( |
9051 new TestSSLConfigService(false /* check for EV */, | 9113 false /* check for EV */, false /* online revocation checking */, |
9052 false /* online revocation checking */, | 9114 true /* require rev. checking for local |
9053 true /* require rev. checking for local | 9115 anchors */, |
9054 anchors */)); | 9116 false /* token binding enabled */)); |
9055 } | 9117 } |
9056 }; | 9118 }; |
9057 | 9119 |
9058 TEST_F(HTTPSHardFailTest, FailsOnOCSPInvalid) { | 9120 TEST_F(HTTPSHardFailTest, FailsOnOCSPInvalid) { |
9059 if (!SystemSupportsOCSP()) { | 9121 if (!SystemSupportsOCSP()) { |
9060 LOG(WARNING) << "Skipping test because system doesn't support OCSP"; | 9122 LOG(WARNING) << "Skipping test because system doesn't support OCSP"; |
9061 return; | 9123 return; |
9062 } | 9124 } |
9063 | 9125 |
9064 if (!SystemSupportsHardFailRevocationChecking()) { | 9126 if (!SystemSupportsHardFailRevocationChecking()) { |
(...skipping 12 matching lines...) Expand all Loading... |
9077 EXPECT_EQ(CERT_STATUS_REVOKED, | 9139 EXPECT_EQ(CERT_STATUS_REVOKED, |
9078 cert_status & CERT_STATUS_REVOKED); | 9140 cert_status & CERT_STATUS_REVOKED); |
9079 | 9141 |
9080 // Without a positive OCSP response, we shouldn't show the EV status. | 9142 // Without a positive OCSP response, we shouldn't show the EV status. |
9081 EXPECT_TRUE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); | 9143 EXPECT_TRUE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); |
9082 } | 9144 } |
9083 | 9145 |
9084 class HTTPSEVCRLSetTest : public HTTPSOCSPTest { | 9146 class HTTPSEVCRLSetTest : public HTTPSOCSPTest { |
9085 protected: | 9147 protected: |
9086 void SetupContext(URLRequestContext* context) override { | 9148 void SetupContext(URLRequestContext* context) override { |
9087 context->set_ssl_config_service( | 9149 context->set_ssl_config_service(new TestSSLConfigService( |
9088 new TestSSLConfigService(true /* check for EV */, | 9150 true /* check for EV */, false /* online revocation checking */, |
9089 false /* online revocation checking */, | 9151 false /* require rev. checking for local |
9090 false /* require rev. checking for local | 9152 anchors */, |
9091 anchors */)); | 9153 false /* token binding enabled */)); |
9092 } | 9154 } |
9093 }; | 9155 }; |
9094 | 9156 |
9095 TEST_F(HTTPSEVCRLSetTest, MissingCRLSetAndInvalidOCSP) { | 9157 TEST_F(HTTPSEVCRLSetTest, MissingCRLSetAndInvalidOCSP) { |
9096 if (!SystemSupportsOCSP()) { | 9158 if (!SystemSupportsOCSP()) { |
9097 LOG(WARNING) << "Skipping test because system doesn't support OCSP"; | 9159 LOG(WARNING) << "Skipping test because system doesn't support OCSP"; |
9098 return; | 9160 return; |
9099 } | 9161 } |
9100 | 9162 |
9101 SpawnedTestServer::SSLOptions ssl_options( | 9163 SpawnedTestServer::SSLOptions ssl_options( |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9262 | 9324 |
9263 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS); | 9325 EXPECT_EQ(0u, cert_status & CERT_STATUS_ALL_ERRORS); |
9264 | 9326 |
9265 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); | 9327 EXPECT_FALSE(cert_status & CERT_STATUS_IS_EV); |
9266 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); | 9328 EXPECT_FALSE(cert_status & CERT_STATUS_REV_CHECKING_ENABLED); |
9267 } | 9329 } |
9268 | 9330 |
9269 class HTTPSCRLSetTest : public HTTPSOCSPTest { | 9331 class HTTPSCRLSetTest : public HTTPSOCSPTest { |
9270 protected: | 9332 protected: |
9271 void SetupContext(URLRequestContext* context) override { | 9333 void SetupContext(URLRequestContext* context) override { |
9272 context->set_ssl_config_service( | 9334 context->set_ssl_config_service(new TestSSLConfigService( |
9273 new TestSSLConfigService(false /* check for EV */, | 9335 false /* check for EV */, false /* online revocation checking */, |
9274 false /* online revocation checking */, | 9336 false /* require rev. checking for local |
9275 false /* require rev. checking for local | 9337 anchors */, |
9276 anchors */)); | 9338 false /* token binding enabled */)); |
9277 } | 9339 } |
9278 }; | 9340 }; |
9279 | 9341 |
9280 TEST_F(HTTPSCRLSetTest, ExpiredCRLSet) { | 9342 TEST_F(HTTPSCRLSetTest, ExpiredCRLSet) { |
9281 SpawnedTestServer::SSLOptions ssl_options( | 9343 SpawnedTestServer::SSLOptions ssl_options( |
9282 SpawnedTestServer::SSLOptions::CERT_AUTO); | 9344 SpawnedTestServer::SSLOptions::CERT_AUTO); |
9283 ssl_options.ocsp_status = SpawnedTestServer::SSLOptions::OCSP_INVALID; | 9345 ssl_options.ocsp_status = SpawnedTestServer::SSLOptions::OCSP_INVALID; |
9284 SSLConfigService::SetCRLSet( | 9346 SSLConfigService::SetCRLSet( |
9285 scoped_refptr<CRLSet>(CRLSet::ExpiredCRLSetForTesting())); | 9347 scoped_refptr<CRLSet>(CRLSet::ExpiredCRLSetForTesting())); |
9286 | 9348 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9696 | 9758 |
9697 req->Start(); | 9759 req->Start(); |
9698 req->Cancel(); | 9760 req->Cancel(); |
9699 job->DetachRequest(); | 9761 job->DetachRequest(); |
9700 base::RunLoop().RunUntilIdle(); | 9762 base::RunLoop().RunUntilIdle(); |
9701 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); | 9763 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); |
9702 EXPECT_EQ(0, d.received_redirect_count()); | 9764 EXPECT_EQ(0, d.received_redirect_count()); |
9703 } | 9765 } |
9704 | 9766 |
9705 } // namespace net | 9767 } // namespace net |
OLD | NEW |