Chromium Code Reviews| 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 ac37c70d21cb21c348451b7675ac748578f4cda0..d4a550472053690de5b6549382b998c63e1db896 100644 |
| --- a/net/test/spawned_test_server/base_test_server.cc |
| +++ b/net/test/spawned_test_server/base_test_server.cc |
| @@ -40,6 +40,13 @@ std::string GetHostname(BaseTestServer::Type type, |
| return BaseTestServer::kLocalhost; |
| } |
| +void GetKeyExchangesList(int key_exchange, base::ListValue* values) { |
| + if (key_exchange & BaseTestServer::SSLOptions::KEY_EXCHANGE_RSA) |
| + values->Append(new base::StringValue("rsa")); |
| + if (key_exchange & BaseTestServer::SSLOptions::KEY_EXCHANGE_DHE_RSA) |
| + values->Append(new base::StringValue("dhe_rsa")); |
| +} |
| + |
| void GetCiphersList(int cipher, base::ListValue* values) { |
| if (cipher & BaseTestServer::SSLOptions::BULK_CIPHER_RC4) |
| values->Append(new base::StringValue("rc4")); |
| @@ -58,11 +65,13 @@ BaseTestServer::SSLOptions::SSLOptions() |
| ocsp_status(OCSP_OK), |
| cert_serial(0), |
| request_client_certificate(false), |
| + key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), |
| bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), |
| record_resume(false), |
| tls_intolerant(TLS_INTOLERANT_NONE), |
| fallback_scsv_enabled(false), |
| - staple_ocsp_response(false) {} |
| + staple_ocsp_response(false), |
| + support_npn(false) {} |
| BaseTestServer::SSLOptions::SSLOptions( |
| BaseTestServer::SSLOptions::ServerCertificate cert) |
| @@ -70,11 +79,13 @@ BaseTestServer::SSLOptions::SSLOptions( |
| ocsp_status(OCSP_OK), |
| cert_serial(0), |
| request_client_certificate(false), |
| + key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), |
| bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), |
| record_resume(false), |
| tls_intolerant(TLS_INTOLERANT_NONE), |
| fallback_scsv_enabled(false), |
| - staple_ocsp_response(false) {} |
| + staple_ocsp_response(false), |
| + support_npn(false) {} |
| BaseTestServer::SSLOptions::~SSLOptions() {} |
| @@ -389,6 +400,11 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const { |
| base::Value::CreateIntegerValue(ssl_options_.cert_serial)); |
| } |
| + // Check key exchange argument. |
| + scoped_ptr<base::ListValue> key_exchange_values(new base::ListValue()); |
| + GetKeyExchangesList(ssl_options_.key_exchanges, key_exchange_values.get()); |
| + if (key_exchange_values->GetSize()) |
| + arguments->Set("ssl-key-exchange", key_exchange_values.release()); |
| // Check bulk cipher argument. |
| scoped_ptr<base::ListValue> bulk_cipher_values(new base::ListValue()); |
| GetCiphersList(ssl_options_.bulk_ciphers, bulk_cipher_values.get()); |
| @@ -410,6 +426,8 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const { |
| } |
| if (ssl_options_.staple_ocsp_response) |
| arguments->Set("staple-ocsp-response", base::Value::CreateNullValue()); |
| + if (ssl_options_.support_npn) |
| + arguments->Set("next-proto", base::Value::CreateStringValue("http/1.1")); |
|
Ryan Sleevi
2014/04/02 22:09:13
Should this be a string option, rather than a bool
davidben
2014/04/03 19:38:36
Well, I suppose if we want to go really crazy, it
|
| } |
| return GenerateAdditionalArguments(arguments); |