| OLD | NEW |
| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 return base::FilePath(FILE_PATH_LITERAL("localhost_cert.pem")); | 217 return base::FilePath(FILE_PATH_LITERAL("localhost_cert.pem")); |
| 218 case CERT_EXPIRED: | 218 case CERT_EXPIRED: |
| 219 return base::FilePath(FILE_PATH_LITERAL("expired_cert.pem")); | 219 return base::FilePath(FILE_PATH_LITERAL("expired_cert.pem")); |
| 220 case CERT_CHAIN_WRONG_ROOT: | 220 case CERT_CHAIN_WRONG_ROOT: |
| 221 // This chain uses its own dedicated test root certificate to avoid | 221 // This chain uses its own dedicated test root certificate to avoid |
| 222 // side-effects that may affect testing. | 222 // side-effects that may affect testing. |
| 223 return base::FilePath(FILE_PATH_LITERAL("redundant-server-chain.pem")); | 223 return base::FilePath(FILE_PATH_LITERAL("redundant-server-chain.pem")); |
| 224 case CERT_BAD_VALIDITY: | 224 case CERT_BAD_VALIDITY: |
| 225 return base::FilePath(FILE_PATH_LITERAL("bad_validity.pem")); | 225 return base::FilePath(FILE_PATH_LITERAL("bad_validity.pem")); |
| 226 case CERT_AUTO: | 226 case CERT_AUTO: |
| 227 case CERT_AUTO_AIA_INTERMEDIATE: |
| 227 return base::FilePath(); | 228 return base::FilePath(); |
| 228 default: | 229 default: |
| 229 NOTREACHED(); | 230 NOTREACHED(); |
| 230 } | 231 } |
| 231 return base::FilePath(); | 232 return base::FilePath(); |
| 232 } | 233 } |
| 233 | 234 |
| 234 std::string BaseTestServer::SSLOptions::GetOCSPArgument() const { | 235 std::string BaseTestServer::SSLOptions::GetOCSPArgument() const { |
| 235 if (server_certificate != CERT_AUTO) | 236 if (server_certificate != CERT_AUTO) |
| 236 return std::string(); | 237 return std::string(); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 client_cert_types->AppendString( | 586 client_cert_types->AppendString( |
| 586 GetClientCertType(ssl_options_.client_cert_types[i])); | 587 GetClientCertType(ssl_options_.client_cert_types[i])); |
| 587 } | 588 } |
| 588 if (client_cert_types->GetSize()) | 589 if (client_cert_types->GetSize()) |
| 589 arguments->Set("ssl-client-cert-type", client_cert_types.release()); | 590 arguments->Set("ssl-client-cert-type", client_cert_types.release()); |
| 590 } | 591 } |
| 591 | 592 |
| 592 if (type_ == TYPE_HTTPS) { | 593 if (type_ == TYPE_HTTPS) { |
| 593 arguments->Set("https", base::Value::CreateNullValue()); | 594 arguments->Set("https", base::Value::CreateNullValue()); |
| 594 | 595 |
| 596 if (ssl_options_.server_certificate == |
| 597 SSLOptions::CERT_AUTO_AIA_INTERMEDIATE) |
| 598 arguments->Set("aia-intermediate", base::Value::CreateNullValue()); |
| 599 |
| 595 std::string ocsp_arg = ssl_options_.GetOCSPArgument(); | 600 std::string ocsp_arg = ssl_options_.GetOCSPArgument(); |
| 596 if (!ocsp_arg.empty()) | 601 if (!ocsp_arg.empty()) |
| 597 arguments->SetString("ocsp", ocsp_arg); | 602 arguments->SetString("ocsp", ocsp_arg); |
| 598 | 603 |
| 599 std::string ocsp_date_arg = ssl_options_.GetOCSPDateArgument(); | 604 std::string ocsp_date_arg = ssl_options_.GetOCSPDateArgument(); |
| 600 if (!ocsp_date_arg.empty()) | 605 if (!ocsp_date_arg.empty()) |
| 601 arguments->SetString("ocsp-date", ocsp_date_arg); | 606 arguments->SetString("ocsp-date", ocsp_date_arg); |
| 602 | 607 |
| 603 std::string ocsp_produced_arg = ssl_options_.GetOCSPProducedArgument(); | 608 std::string ocsp_produced_arg = ssl_options_.GetOCSPProducedArgument(); |
| 604 if (!ocsp_produced_arg.empty()) | 609 if (!ocsp_produced_arg.empty()) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 | 678 |
| 674 return GenerateAdditionalArguments(arguments); | 679 return GenerateAdditionalArguments(arguments); |
| 675 } | 680 } |
| 676 | 681 |
| 677 bool BaseTestServer::GenerateAdditionalArguments( | 682 bool BaseTestServer::GenerateAdditionalArguments( |
| 678 base::DictionaryValue* arguments) const { | 683 base::DictionaryValue* arguments) const { |
| 679 return true; | 684 return true; |
| 680 } | 685 } |
| 681 | 686 |
| 682 } // namespace net | 687 } // namespace net |
| OLD | NEW |