Chromium Code Reviews| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 8379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8390 } // namespace | 8390 } // namespace |
| 8391 | 8391 |
| 8392 // TODO(davidben): Test the rest of the code. Specifically, | 8392 // TODO(davidben): Test the rest of the code. Specifically, |
| 8393 // - Filtering which certificates to select. | 8393 // - Filtering which certificates to select. |
| 8394 // - Sending a certificate back. | 8394 // - Sending a certificate back. |
| 8395 // - Getting a certificate request in an SSL renegotiation sending the | 8395 // - Getting a certificate request in an SSL renegotiation sending the |
| 8396 // HTTP request. | 8396 // HTTP request. |
| 8397 TEST_F(HTTPSRequestTest, ClientAuthTest) { | 8397 TEST_F(HTTPSRequestTest, ClientAuthTest) { |
| 8398 EmbeddedTestServer test_server(net::EmbeddedTestServer::TYPE_HTTPS); | 8398 EmbeddedTestServer test_server(net::EmbeddedTestServer::TYPE_HTTPS); |
| 8399 net::SSLServerConfig ssl_config; | 8399 net::SSLServerConfig ssl_config; |
| 8400 ssl_config.require_client_cert = true; | 8400 ssl_config.client_cert_type = |
|
davidben
2016/02/17 22:46:03
(Oh, pfft. Did we call this require_client_cert bu
| |
| 8401 SSLServerConfig::ClientCertType::OPTIONAL_CLIENT_CERT; | |
| 8401 test_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); | 8402 test_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); |
| 8402 test_server.AddDefaultHandlers( | 8403 test_server.AddDefaultHandlers( |
| 8403 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 8404 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
| 8404 ASSERT_TRUE(test_server.Start()); | 8405 ASSERT_TRUE(test_server.Start()); |
| 8405 | 8406 |
| 8406 SSLClientAuthTestDelegate d; | 8407 SSLClientAuthTestDelegate d; |
| 8407 { | 8408 { |
| 8408 scoped_ptr<URLRequest> r(default_context_.CreateRequest( | 8409 scoped_ptr<URLRequest> r(default_context_.CreateRequest( |
| 8409 test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d)); | 8410 test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d)); |
| 8410 | 8411 |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9863 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 9864 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
| 9864 | 9865 |
| 9865 req->Start(); | 9866 req->Start(); |
| 9866 req->Cancel(); | 9867 req->Cancel(); |
| 9867 base::RunLoop().RunUntilIdle(); | 9868 base::RunLoop().RunUntilIdle(); |
| 9868 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); | 9869 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); |
| 9869 EXPECT_EQ(0, d.received_redirect_count()); | 9870 EXPECT_EQ(0, d.received_redirect_count()); |
| 9870 } | 9871 } |
| 9871 | 9872 |
| 9872 } // namespace net | 9873 } // namespace net |
| OLD | NEW |