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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 crypto::ScopedTestNSSDB test_nssdb; | 666 crypto::ScopedTestNSSDB test_nssdb; |
667 ASSERT_TRUE(test_nssdb.is_open()); | 667 ASSERT_TRUE(test_nssdb.is_open()); |
668 | 668 |
669 // Import client cert for test. These interfaces require NSS. | 669 // Import client cert for test. These interfaces require NSS. |
670 net::NSSCertDatabase* cert_db = net::NSSCertDatabase::GetInstance(); | 670 net::NSSCertDatabase* cert_db = net::NSSCertDatabase::GetInstance(); |
671 scoped_refptr<net::CryptoModule> crypt_module = cert_db->GetPublicModule(); | 671 scoped_refptr<net::CryptoModule> crypt_module = cert_db->GetPublicModule(); |
672 std::string pkcs12_data; | 672 std::string pkcs12_data; |
673 base::FilePath cert_path = net::GetTestCertsDirectory().Append( | 673 base::FilePath cert_path = net::GetTestCertsDirectory().Append( |
674 FILE_PATH_LITERAL("websocket_client_cert.p12")); | 674 FILE_PATH_LITERAL("websocket_client_cert.p12")); |
675 EXPECT_TRUE(file_util::ReadFileToString(cert_path, &pkcs12_data)); | 675 EXPECT_TRUE(file_util::ReadFileToString(cert_path, &pkcs12_data)); |
676 EXPECT_EQ(net::OK, cert_db->ImportFromPKCS12(crypt_module, | 676 EXPECT_EQ(net::OK, |
677 pkcs12_data, | 677 cert_db->ImportFromPKCS12( |
678 string16(), | 678 crypt_module.get(), pkcs12_data, string16(), true, NULL)); |
679 true, | |
680 NULL)); | |
681 | 679 |
682 // Start WebSocket test server with TLS and client cert authentication. | 680 // Start WebSocket test server with TLS and client cert authentication. |
683 net::SpawnedTestServer::SSLOptions options( | 681 net::SpawnedTestServer::SSLOptions options( |
684 net::SpawnedTestServer::SSLOptions::CERT_OK); | 682 net::SpawnedTestServer::SSLOptions::CERT_OK); |
685 options.request_client_certificate = true; | 683 options.request_client_certificate = true; |
686 base::FilePath ca_path = net::GetTestCertsDirectory().Append( | 684 base::FilePath ca_path = net::GetTestCertsDirectory().Append( |
687 FILE_PATH_LITERAL("websocket_cacert.pem")); | 685 FILE_PATH_LITERAL("websocket_cacert.pem")); |
688 options.client_authorities.push_back(ca_path); | 686 options.client_authorities.push_back(ca_path); |
689 net::SpawnedTestServer wss_server(net::SpawnedTestServer::TYPE_WSS, | 687 net::SpawnedTestServer wss_server(net::SpawnedTestServer::TYPE_WSS, |
690 options, | 688 options, |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 | 1647 |
1650 // Visit a page over https that contains a frame with a redirect. | 1648 // Visit a page over https that contains a frame with a redirect. |
1651 | 1649 |
1652 // XMLHttpRequest insecure content in synchronous mode. | 1650 // XMLHttpRequest insecure content in synchronous mode. |
1653 | 1651 |
1654 // XMLHttpRequest insecure content in asynchronous mode. | 1652 // XMLHttpRequest insecure content in asynchronous mode. |
1655 | 1653 |
1656 // XMLHttpRequest over bad ssl in synchronous mode. | 1654 // XMLHttpRequest over bad ssl in synchronous mode. |
1657 | 1655 |
1658 // XMLHttpRequest over OK ssl in synchronous mode. | 1656 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |