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

Unified Diff: net/test/spawned_test_server/base_test_server.cc

Issue 257513008: Populate cert_key_types on OpenSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Line length (try jobs on #8) Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/spawned_test_server/base_test_server.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/base_test_server.cc
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index a781c6e94042288c67e345286861d6ccf3deeb82..016c9301edf69ee18bbed20f2805567b0d26eeff 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -40,6 +40,20 @@ std::string GetHostname(BaseTestServer::Type type,
return BaseTestServer::kLocalhost;
}
+std::string GetClientCertType(SSLClientCertType type) {
+ switch (type) {
+ case CLIENT_CERT_RSA_SIGN:
+ return "rsa_sign";
+ case CLIENT_CERT_DSS_SIGN:
+ return "dss_sign";
+ case CLIENT_CERT_ECDSA_SIGN:
+ return "ecdsa_sign";
+ default:
+ NOTREACHED();
+ return "";
+ }
+}
+
void GetKeyExchangesList(int key_exchange, base::ListValue* values) {
if (key_exchange & BaseTestServer::SSLOptions::KEY_EXCHANGE_RSA)
values->Append(new base::StringValue("rsa"));
@@ -386,6 +400,14 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
if (ssl_client_certs->GetSize())
arguments->Set("ssl-client-ca", ssl_client_certs.release());
+
+ scoped_ptr<base::ListValue> client_cert_types(new base::ListValue());
+ for (size_t i = 0; i < ssl_options_.client_cert_types.size(); i++) {
+ client_cert_types->Append(new base::StringValue(
+ GetClientCertType(ssl_options_.client_cert_types[i])));
+ }
+ if (client_cert_types->GetSize())
+ arguments->Set("ssl-client-cert-type", client_cert_types.release());
}
if (type_ == TYPE_HTTPS) {
« no previous file with comments | « net/test/spawned_test_server/base_test_server.h ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698