OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base_test_server.h" | 5 #include "net/test/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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 } // namespace | 54 } // namespace |
55 | 55 |
56 BaseTestServer::HTTPSOptions::HTTPSOptions() | 56 BaseTestServer::HTTPSOptions::HTTPSOptions() |
57 : server_certificate(CERT_OK), | 57 : server_certificate(CERT_OK), |
58 ocsp_status(OCSP_OK), | 58 ocsp_status(OCSP_OK), |
59 request_client_certificate(false), | 59 request_client_certificate(false), |
60 bulk_ciphers(HTTPSOptions::BULK_CIPHER_ANY), | 60 bulk_ciphers(HTTPSOptions::BULK_CIPHER_ANY), |
61 record_resume(false), | 61 record_resume(false), |
62 tls_intolerant(false) {} | 62 tls_intolerant(TLS_INTOLERANT_NONE) {} |
63 | 63 |
64 BaseTestServer::HTTPSOptions::HTTPSOptions( | 64 BaseTestServer::HTTPSOptions::HTTPSOptions( |
65 BaseTestServer::HTTPSOptions::ServerCertificate cert) | 65 BaseTestServer::HTTPSOptions::ServerCertificate cert) |
66 : server_certificate(cert), | 66 : server_certificate(cert), |
67 request_client_certificate(false), | 67 request_client_certificate(false), |
68 bulk_ciphers(HTTPSOptions::BULK_CIPHER_ANY), | 68 bulk_ciphers(HTTPSOptions::BULK_CIPHER_ANY), |
69 record_resume(false), | 69 record_resume(false), |
70 tls_intolerant(false) {} | 70 tls_intolerant(TLS_INTOLERANT_NONE) {} |
71 | 71 |
72 BaseTestServer::HTTPSOptions::~HTTPSOptions() {} | 72 BaseTestServer::HTTPSOptions::~HTTPSOptions() {} |
73 | 73 |
74 FilePath BaseTestServer::HTTPSOptions::GetCertificateFile() const { | 74 FilePath BaseTestServer::HTTPSOptions::GetCertificateFile() const { |
75 switch (server_certificate) { | 75 switch (server_certificate) { |
76 case CERT_OK: | 76 case CERT_OK: |
77 case CERT_MISMATCHED_NAME: | 77 case CERT_MISMATCHED_NAME: |
78 return FilePath(FILE_PATH_LITERAL("ok_cert.pem")); | 78 return FilePath(FILE_PATH_LITERAL("ok_cert.pem")); |
79 case CERT_EXPIRED: | 79 case CERT_EXPIRED: |
80 return FilePath(FILE_PATH_LITERAL("expired_cert.pem")); | 80 return FilePath(FILE_PATH_LITERAL("expired_cert.pem")); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 if (ssl_client_certs->GetSize()) | 370 if (ssl_client_certs->GetSize()) |
371 arguments->Set("ssl-client-ca", ssl_client_certs.release()); | 371 arguments->Set("ssl-client-ca", ssl_client_certs.release()); |
372 | 372 |
373 // Check bulk cipher argument. | 373 // Check bulk cipher argument. |
374 scoped_ptr<base::ListValue> bulk_cipher_values(new base::ListValue()); | 374 scoped_ptr<base::ListValue> bulk_cipher_values(new base::ListValue()); |
375 GetCiphersList(https_options_.bulk_ciphers, bulk_cipher_values.get()); | 375 GetCiphersList(https_options_.bulk_ciphers, bulk_cipher_values.get()); |
376 if (bulk_cipher_values->GetSize()) | 376 if (bulk_cipher_values->GetSize()) |
377 arguments->Set("ssl-bulk-cipher", bulk_cipher_values.release()); | 377 arguments->Set("ssl-bulk-cipher", bulk_cipher_values.release()); |
378 if (https_options_.record_resume) | 378 if (https_options_.record_resume) |
379 arguments->Set("https-record-resume", base::Value::CreateNullValue()); | 379 arguments->Set("https-record-resume", base::Value::CreateNullValue()); |
380 if (https_options_.tls_intolerant) | 380 if (https_options_.tls_intolerant != HTTPSOptions::TLS_INTOLERANT_NONE) { |
381 arguments->Set("tls-intolerant", base::Value::CreateNullValue()); | 381 arguments->Set("tls-intolerant", |
| 382 base::Value::CreateIntegerValue(https_options_.tls_intolerant)); |
| 383 } |
382 } | 384 } |
383 return true; | 385 return true; |
384 } | 386 } |
385 | 387 |
386 } // namespace net | 388 } // namespace net |
OLD | NEW |