diff options
author | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-07 20:25:46 +0000 |
---|---|---|
committer | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-07 20:25:46 +0000 |
commit | ea224582f14bb849ccab853de7e63e2ffa75994a (patch) | |
tree | 696e1da077c7b448f8fed2464a4ce42a88103a9c /net/base/ssl_test_util.h | |
parent | 3d2b7b5f90e42a435b1ef1f55c39e60c3a846485 (diff) | |
download | chromium_src-ea224582f14bb849ccab853de7e63e2ffa75994a.zip chromium_src-ea224582f14bb849ccab853de7e63e2ffa75994a.tar.gz chromium_src-ea224582f14bb849ccab853de7e63e2ffa75994a.tar.bz2 |
Third time's a charm?
Fix part of http://code.google.com/p/chromium/issues/detail?id=4510
and improve https support in test shell on linux.
This is the same as the earlier ssl cert cl
(see http://codereview.chromium.org/11249),
but with the certs moved so net can use them without
reaching over into chrome's pants and causing
test failure on the 'modules' Windows build server,
which is set up to test net and base but not chrome.
For this to pass, we will need to install
the certs on the windows module and try servers.
(And make sure tlslite is present.)
(A later CL will finish implementing SSLInfo for Linux,
and probably reference net/base/ssl_test_util.cc
from all three vcproj files that need it,
even though that's ugly, because that's less ugly
that referencing it from net.lib's vcproj.)
Review URL: http://codereview.chromium.org/12930
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/ssl_test_util.h')
-rw-r--r-- | net/base/ssl_test_util.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/net/base/ssl_test_util.h b/net/base/ssl_test_util.h index e69de29..9daa4cc 100644 --- a/net/base/ssl_test_util.h +++ b/net/base/ssl_test_util.h @@ -0,0 +1,53 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_BASE_SSL_TEST_UTIL_H_ +#define NET_BASE_SSL_TEST_UTIL_H_ + +#include "build/build_config.h" + +#include "base/file_path.h" + +// TODO(dkegel): share this between net/base and +// chrome/browser without putting it in net.lib + +class SSLTestUtil { + public: + SSLTestUtil(); + + ~SSLTestUtil(); + + FilePath GetRootCertPath(); + + FilePath GetOKCertPath(); + + FilePath GetExpiredCertPath(); + + // Hostname to use for test server + static const char kHostName[]; + + // Port to use for test server + static const int kOKHTTPSPort; + + // Port to use for bad test server + static const int kBadHTTPSPort; + + // Issuer name of the cert that should be trusted for the test to work. + static const wchar_t kCertIssuerName[]; + + // Returns false if our test root certificate is not trusted. + bool CheckCATrusted(); + + private: + FilePath cert_dir_; + +#if defined(OS_LINUX) + struct PrivateCERTCertificate; + PrivateCERTCertificate *cert_; +#endif + + DISALLOW_COPY_AND_ASSIGN(SSLTestUtil); +}; + +#endif // NET_BASE_SSL_TEST_UTIL_H_ |