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

Side by Side Diff: net/test/spawned_test_server/base_test_server.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/test/spawned_test_server/base_test_server.h" 5 #include "net/test/spawned_test_server/base_test_server.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 ocsp_status(OCSP_OK), 94 ocsp_status(OCSP_OK),
95 cert_serial(0), 95 cert_serial(0),
96 request_client_certificate(false), 96 request_client_certificate(false),
97 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), 97 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY),
98 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), 98 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY),
99 record_resume(false), 99 record_resume(false),
100 tls_intolerant(TLS_INTOLERANT_NONE), 100 tls_intolerant(TLS_INTOLERANT_NONE),
101 tls_intolerance_type(TLS_INTOLERANCE_ALERT), 101 tls_intolerance_type(TLS_INTOLERANCE_ALERT),
102 fallback_scsv_enabled(false), 102 fallback_scsv_enabled(false),
103 staple_ocsp_response(false), 103 staple_ocsp_response(false),
104 ocsp_server_unavailable(false),
104 enable_npn(false), 105 enable_npn(false),
105 disable_session_cache(false) { 106 disable_session_cache(false) {
106 } 107 }
107 108
108 BaseTestServer::SSLOptions::SSLOptions( 109 BaseTestServer::SSLOptions::SSLOptions(
109 BaseTestServer::SSLOptions::ServerCertificate cert) 110 BaseTestServer::SSLOptions::ServerCertificate cert)
110 : server_certificate(cert), 111 : server_certificate(cert),
111 ocsp_status(OCSP_OK), 112 ocsp_status(OCSP_OK),
112 cert_serial(0), 113 cert_serial(0),
113 request_client_certificate(false), 114 request_client_certificate(false),
114 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY), 115 key_exchanges(SSLOptions::KEY_EXCHANGE_ANY),
115 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY), 116 bulk_ciphers(SSLOptions::BULK_CIPHER_ANY),
116 record_resume(false), 117 record_resume(false),
117 tls_intolerant(TLS_INTOLERANT_NONE), 118 tls_intolerant(TLS_INTOLERANT_NONE),
118 tls_intolerance_type(TLS_INTOLERANCE_ALERT), 119 tls_intolerance_type(TLS_INTOLERANCE_ALERT),
119 fallback_scsv_enabled(false), 120 fallback_scsv_enabled(false),
120 staple_ocsp_response(false), 121 staple_ocsp_response(false),
122 ocsp_server_unavailable(false),
121 enable_npn(false), 123 enable_npn(false),
122 disable_session_cache(false) { 124 disable_session_cache(false) {
123 } 125 }
124 126
125 BaseTestServer::SSLOptions::~SSLOptions() {} 127 BaseTestServer::SSLOptions::~SSLOptions() {}
126 128
127 base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const { 129 base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const {
128 switch (server_certificate) { 130 switch (server_certificate) {
129 case CERT_OK: 131 case CERT_OK:
130 case CERT_MISMATCHED_NAME: 132 case CERT_MISMATCHED_NAME:
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 if (ssl_options_.fallback_scsv_enabled) 471 if (ssl_options_.fallback_scsv_enabled)
470 arguments->Set("fallback-scsv", base::Value::CreateNullValue()); 472 arguments->Set("fallback-scsv", base::Value::CreateNullValue());
471 if (!ssl_options_.signed_cert_timestamps_tls_ext.empty()) { 473 if (!ssl_options_.signed_cert_timestamps_tls_ext.empty()) {
472 std::string b64_scts_tls_ext; 474 std::string b64_scts_tls_ext;
473 base::Base64Encode(ssl_options_.signed_cert_timestamps_tls_ext, 475 base::Base64Encode(ssl_options_.signed_cert_timestamps_tls_ext,
474 &b64_scts_tls_ext); 476 &b64_scts_tls_ext);
475 arguments->SetString("signed-cert-timestamps-tls-ext", b64_scts_tls_ext); 477 arguments->SetString("signed-cert-timestamps-tls-ext", b64_scts_tls_ext);
476 } 478 }
477 if (ssl_options_.staple_ocsp_response) 479 if (ssl_options_.staple_ocsp_response)
478 arguments->Set("staple-ocsp-response", base::Value::CreateNullValue()); 480 arguments->Set("staple-ocsp-response", base::Value::CreateNullValue());
481 if (ssl_options_.ocsp_server_unavailable) {
482 arguments->Set("ocsp-server-unavailable",
483 base::Value::CreateNullValue());
484 }
479 if (ssl_options_.enable_npn) 485 if (ssl_options_.enable_npn)
480 arguments->Set("enable-npn", base::Value::CreateNullValue()); 486 arguments->Set("enable-npn", base::Value::CreateNullValue());
481 if (ssl_options_.disable_session_cache) 487 if (ssl_options_.disable_session_cache)
482 arguments->Set("disable-session-cache", base::Value::CreateNullValue()); 488 arguments->Set("disable-session-cache", base::Value::CreateNullValue());
483 } 489 }
484 490
485 return GenerateAdditionalArguments(arguments); 491 return GenerateAdditionalArguments(arguments);
486 } 492 }
487 493
488 bool BaseTestServer::GenerateAdditionalArguments( 494 bool BaseTestServer::GenerateAdditionalArguments(
489 base::DictionaryValue* arguments) const { 495 base::DictionaryValue* arguments) const {
490 return true; 496 return true;
491 } 497 }
492 498
493 } // namespace net 499 } // namespace net
OLDNEW
« no previous file with comments | « net/test/spawned_test_server/base_test_server.h ('k') | net/test/url_request/url_request_mock_http_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698