| 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 it != ssl_options_.client_authorities.end(); ++it) { | 573 it != ssl_options_.client_authorities.end(); ++it) { |
| 574 if (it->IsAbsolute() && !base::PathExists(*it)) { | 574 if (it->IsAbsolute() && !base::PathExists(*it)) { |
| 575 LOG(ERROR) << "Client authority path " << it->value() | 575 LOG(ERROR) << "Client authority path " << it->value() |
| 576 << " doesn't exist. Can't launch https server."; | 576 << " doesn't exist. Can't launch https server."; |
| 577 return false; | 577 return false; |
| 578 } | 578 } |
| 579 ssl_client_certs->AppendString(it->value()); | 579 ssl_client_certs->AppendString(it->value()); |
| 580 } | 580 } |
| 581 | 581 |
| 582 if (ssl_client_certs->GetSize()) | 582 if (ssl_client_certs->GetSize()) |
| 583 arguments->Set("ssl-client-ca", ssl_client_certs.release()); | 583 arguments->Set("ssl-client-ca", std::move(ssl_client_certs)); |
| 584 | 584 |
| 585 std::unique_ptr<base::ListValue> client_cert_types(new base::ListValue()); | 585 std::unique_ptr<base::ListValue> client_cert_types(new base::ListValue()); |
| 586 for (size_t i = 0; i < ssl_options_.client_cert_types.size(); i++) { | 586 for (size_t i = 0; i < ssl_options_.client_cert_types.size(); i++) { |
| 587 client_cert_types->AppendString( | 587 client_cert_types->AppendString( |
| 588 GetClientCertType(ssl_options_.client_cert_types[i])); | 588 GetClientCertType(ssl_options_.client_cert_types[i])); |
| 589 } | 589 } |
| 590 if (client_cert_types->GetSize()) | 590 if (client_cert_types->GetSize()) |
| 591 arguments->Set("ssl-client-cert-type", client_cert_types.release()); | 591 arguments->Set("ssl-client-cert-type", std::move(client_cert_types)); |
| 592 } | 592 } |
| 593 | 593 |
| 594 if (type_ == TYPE_HTTPS) { | 594 if (type_ == TYPE_HTTPS) { |
| 595 arguments->Set("https", base::MakeUnique<base::Value>()); | 595 arguments->Set("https", base::MakeUnique<base::Value>()); |
| 596 | 596 |
| 597 if (ssl_options_.server_certificate == | 597 if (ssl_options_.server_certificate == |
| 598 SSLOptions::CERT_AUTO_AIA_INTERMEDIATE) | 598 SSLOptions::CERT_AUTO_AIA_INTERMEDIATE) |
| 599 arguments->Set("aia-intermediate", base::MakeUnique<base::Value>()); | 599 arguments->Set("aia-intermediate", base::MakeUnique<base::Value>()); |
| 600 | 600 |
| 601 std::string ocsp_arg = ssl_options_.GetOCSPArgument(); | 601 std::string ocsp_arg = ssl_options_.GetOCSPArgument(); |
| 602 if (!ocsp_arg.empty()) | 602 if (!ocsp_arg.empty()) |
| 603 arguments->SetString("ocsp", ocsp_arg); | 603 arguments->SetString("ocsp", ocsp_arg); |
| 604 | 604 |
| 605 std::string ocsp_date_arg = ssl_options_.GetOCSPDateArgument(); | 605 std::string ocsp_date_arg = ssl_options_.GetOCSPDateArgument(); |
| 606 if (!ocsp_date_arg.empty()) | 606 if (!ocsp_date_arg.empty()) |
| 607 arguments->SetString("ocsp-date", ocsp_date_arg); | 607 arguments->SetString("ocsp-date", ocsp_date_arg); |
| 608 | 608 |
| 609 std::string ocsp_produced_arg = ssl_options_.GetOCSPProducedArgument(); | 609 std::string ocsp_produced_arg = ssl_options_.GetOCSPProducedArgument(); |
| 610 if (!ocsp_produced_arg.empty()) | 610 if (!ocsp_produced_arg.empty()) |
| 611 arguments->SetString("ocsp-produced", ocsp_produced_arg); | 611 arguments->SetString("ocsp-produced", ocsp_produced_arg); |
| 612 | 612 |
| 613 if (ssl_options_.cert_serial != 0) { | 613 if (ssl_options_.cert_serial != 0) { |
| 614 arguments->SetInteger("cert-serial", ssl_options_.cert_serial); | 614 arguments->SetInteger("cert-serial", ssl_options_.cert_serial); |
| 615 } | 615 } |
| 616 | 616 |
| 617 // Check key exchange argument. | 617 // Check key exchange argument. |
| 618 std::unique_ptr<base::ListValue> key_exchange_values(new base::ListValue()); | 618 std::unique_ptr<base::ListValue> key_exchange_values(new base::ListValue()); |
| 619 GetKeyExchangesList(ssl_options_.key_exchanges, key_exchange_values.get()); | 619 GetKeyExchangesList(ssl_options_.key_exchanges, key_exchange_values.get()); |
| 620 if (key_exchange_values->GetSize()) | 620 if (key_exchange_values->GetSize()) |
| 621 arguments->Set("ssl-key-exchange", key_exchange_values.release()); | 621 arguments->Set("ssl-key-exchange", std::move(key_exchange_values)); |
| 622 // Check bulk cipher argument. | 622 // Check bulk cipher argument. |
| 623 std::unique_ptr<base::ListValue> bulk_cipher_values(new base::ListValue()); | 623 std::unique_ptr<base::ListValue> bulk_cipher_values(new base::ListValue()); |
| 624 GetCiphersList(ssl_options_.bulk_ciphers, bulk_cipher_values.get()); | 624 GetCiphersList(ssl_options_.bulk_ciphers, bulk_cipher_values.get()); |
| 625 if (bulk_cipher_values->GetSize()) | 625 if (bulk_cipher_values->GetSize()) |
| 626 arguments->Set("ssl-bulk-cipher", bulk_cipher_values.release()); | 626 arguments->Set("ssl-bulk-cipher", std::move(bulk_cipher_values)); |
| 627 if (ssl_options_.record_resume) | 627 if (ssl_options_.record_resume) |
| 628 arguments->Set("https-record-resume", base::MakeUnique<base::Value>()); | 628 arguments->Set("https-record-resume", base::MakeUnique<base::Value>()); |
| 629 if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) { | 629 if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) { |
| 630 arguments->SetInteger("tls-intolerant", ssl_options_.tls_intolerant); | 630 arguments->SetInteger("tls-intolerant", ssl_options_.tls_intolerant); |
| 631 arguments->Set("tls-intolerance-type", GetTLSIntoleranceType( | 631 arguments->Set("tls-intolerance-type", GetTLSIntoleranceType( |
| 632 ssl_options_.tls_intolerance_type)); | 632 ssl_options_.tls_intolerance_type)); |
| 633 } | 633 } |
| 634 if (ssl_options_.fallback_scsv_enabled) | 634 if (ssl_options_.fallback_scsv_enabled) |
| 635 arguments->Set("fallback-scsv", base::MakeUnique<base::Value>()); | 635 arguments->Set("fallback-scsv", base::MakeUnique<base::Value>()); |
| 636 if (!ssl_options_.signed_cert_timestamps_tls_ext.empty()) { | 636 if (!ssl_options_.signed_cert_timestamps_tls_ext.empty()) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 | 679 |
| 680 return GenerateAdditionalArguments(arguments); | 680 return GenerateAdditionalArguments(arguments); |
| 681 } | 681 } |
| 682 | 682 |
| 683 bool BaseTestServer::GenerateAdditionalArguments( | 683 bool BaseTestServer::GenerateAdditionalArguments( |
| 684 base::DictionaryValue* arguments) const { | 684 base::DictionaryValue* arguments) const { |
| 685 return true; | 685 return true; |
| 686 } | 686 } |
| 687 | 687 |
| 688 } // namespace net | 688 } // namespace net |
| OLD | NEW |