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

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

Issue 1474983003: Support for client certs in ssl_server_socket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 4 years, 10 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
« no previous file with comments | « net/ssl/ssl_server_config.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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 =
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
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
OLDNEW
« no previous file with comments | « net/ssl/ssl_server_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698