| Index: net/test/test_server.cc
|
| diff --git a/net/test/test_server.cc b/net/test/test_server.cc
|
| index 0e8c4611e4e0a3c4e16924abf0b4f0b9a9f5ff4f..22a7ed6da1b46006ea3ac3f76580699c7e316852 100644
|
| --- a/net/test/test_server.cc
|
| +++ b/net/test/test_server.cc
|
| @@ -23,10 +23,10 @@
|
| #include "base/string_number_conversions.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "googleurl/src/gurl.h"
|
| -#include "net/base/cert_test_util.h"
|
| #include "net/base/host_port_pair.h"
|
| #include "net/base/host_resolver.h"
|
| #include "net/base/test_completion_callback.h"
|
| +#include "net/base/test_root_certs.h"
|
| #include "net/socket/tcp_client_socket.h"
|
| #include "net/test/python_utils.h"
|
| #include "testing/platform_test.h"
|
| @@ -55,10 +55,6 @@ std::string GetHostname(TestServer::Type type,
|
|
|
| } // namespace
|
|
|
| -#if defined(OS_MACOSX)
|
| -void SetMacTestCertificate(X509Certificate* cert);
|
| -#endif
|
| -
|
| TestServer::HTTPSOptions::HTTPSOptions()
|
| : server_certificate(CERT_OK),
|
| request_client_certificate(false),
|
| @@ -100,9 +96,8 @@ TestServer::TestServer(const HTTPSOptions& https_options,
|
| }
|
|
|
| TestServer::~TestServer() {
|
| -#if defined(OS_MACOSX)
|
| - SetMacTestCertificate(NULL);
|
| -#endif
|
| + TestRootCerts* root_certs = TestRootCerts::GetInstance();
|
| + root_certs->Clear();
|
| Stop();
|
| }
|
|
|
| @@ -129,8 +124,6 @@ bool TestServer::Start() {
|
| if (type_ == TYPE_HTTPS) {
|
| if (!LoadTestRootCert())
|
| return false;
|
| - if (!CheckCATrusted())
|
| - return false;
|
| }
|
|
|
| // Get path to python server script
|
| @@ -301,27 +294,8 @@ FilePath TestServer::GetRootCertificatePath() {
|
| }
|
|
|
| bool TestServer::LoadTestRootCert() {
|
| -#if defined(USE_NSS)
|
| - if (cert_)
|
| - return true;
|
| -
|
| - // TODO(dkegel): figure out how to get this to only happen once?
|
| -
|
| - // This currently leaks a little memory.
|
| - // TODO(dkegel): fix the leak and remove the entry in
|
| - // tools/valgrind/memcheck/suppressions.txt
|
| - ANNOTATE_SCOPED_MEMORY_LEAK; // Tell heap checker about the leak.
|
| - cert_ = LoadTemporaryRootCert(GetRootCertificatePath());
|
| - return (cert_ != NULL);
|
| -#elif defined(OS_MACOSX)
|
| - X509Certificate* cert = LoadTemporaryRootCert(GetRootCertificatePath());
|
| - if (!cert)
|
| - return false;
|
| - SetMacTestCertificate(cert);
|
| - return true;
|
| -#else
|
| - return true;
|
| -#endif
|
| + TestRootCerts* root_certs = TestRootCerts::GetInstance();
|
| + return root_certs->AddFromFile(GetRootCertificatePath());
|
| }
|
|
|
| bool TestServer::AddCommandLineArguments(CommandLine* command_line) const {
|
|
|