Chromium Code Reviews| 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 #ifndef NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ | 5 #ifndef NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ |
| 6 #define NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ | 6 #define NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 // OCSPStatus enumerates the types of OCSP response that the testserver | 65 // OCSPStatus enumerates the types of OCSP response that the testserver |
| 66 // can produce. | 66 // can produce. |
| 67 enum OCSPStatus { | 67 enum OCSPStatus { |
| 68 OCSP_OK, | 68 OCSP_OK, |
| 69 OCSP_REVOKED, | 69 OCSP_REVOKED, |
| 70 OCSP_INVALID, | 70 OCSP_INVALID, |
| 71 OCSP_UNAUTHORIZED, | 71 OCSP_UNAUTHORIZED, |
| 72 OCSP_UNKNOWN, | 72 OCSP_UNKNOWN, |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 // Bitmask of key exchange algorithms that the test server supports and that | |
| 76 // can be selectively enabled or disabled. | |
| 77 enum KeyExchange { | |
| 78 // Special value used to indicate that any algorithm the server supports | |
| 79 // is acceptable. Preferred over explicitly OR-ing all ciphers. | |
|
wtc
2014/04/02 19:26:55
Typo: ciphers => key exchange algorithms
davidben
2014/04/03 19:38:36
Done.
| |
| 80 KEY_EXCHANGE_ANY = 0, | |
| 81 | |
| 82 KEY_EXCHANGE_RSA = (1 << 0), | |
| 83 KEY_EXCHANGE_DHE_RSA = (1 << 1), | |
|
wtc
2014/04/02 19:26:55
The test server actually supports more key exchang
Ryan Sleevi
2014/04/02 22:09:13
Not until we need em :)
davidben
2014/04/03 19:38:36
tlslite does, but the test server will need to pas
| |
| 84 }; | |
| 85 | |
| 75 // Bitmask of bulk encryption algorithms that the test server supports | 86 // Bitmask of bulk encryption algorithms that the test server supports |
| 76 // and that can be selectively enabled or disabled. | 87 // and that can be selectively enabled or disabled. |
| 77 enum BulkCipher { | 88 enum BulkCipher { |
| 78 // Special value used to indicate that any algorithm the server supports | 89 // Special value used to indicate that any algorithm the server supports |
| 79 // is acceptable. Preferred over explicitly OR-ing all ciphers. | 90 // is acceptable. Preferred over explicitly OR-ing all ciphers. |
| 80 BULK_CIPHER_ANY = 0, | 91 BULK_CIPHER_ANY = 0, |
| 81 | 92 |
| 82 BULK_CIPHER_RC4 = (1 << 0), | 93 BULK_CIPHER_RC4 = (1 << 0), |
| 83 BULK_CIPHER_AES128 = (1 << 1), | 94 BULK_CIPHER_AES128 = (1 << 1), |
| 84 BULK_CIPHER_AES256 = (1 << 2), | 95 BULK_CIPHER_AES256 = (1 << 2), |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 // True if a CertificateRequest should be sent to the client during | 138 // True if a CertificateRequest should be sent to the client during |
| 128 // handshaking. | 139 // handshaking. |
| 129 bool request_client_certificate; | 140 bool request_client_certificate; |
| 130 | 141 |
| 131 // If |request_client_certificate| is true, an optional list of files, | 142 // If |request_client_certificate| is true, an optional list of files, |
| 132 // each containing a single, PEM-encoded X.509 certificates. The subject | 143 // each containing a single, PEM-encoded X.509 certificates. The subject |
| 133 // from each certificate will be added to the certificate_authorities | 144 // from each certificate will be added to the certificate_authorities |
| 134 // field of the CertificateRequest. | 145 // field of the CertificateRequest. |
| 135 std::vector<base::FilePath> client_authorities; | 146 std::vector<base::FilePath> client_authorities; |
| 136 | 147 |
| 148 // A bitwise-OR of KeyExchnage that should be used by the | |
| 149 // HTTPS server, or KEY_EXCHANGE_ANY to indicate that all implemented | |
| 150 // key exchange algorithms are acceptable. | |
| 151 int key_exchanges; | |
| 152 | |
| 137 // A bitwise-OR of BulkCipher that should be used by the | 153 // A bitwise-OR of BulkCipher that should be used by the |
| 138 // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented | 154 // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented |
| 139 // ciphers are acceptable. | 155 // ciphers are acceptable. |
| 140 int bulk_ciphers; | 156 int bulk_ciphers; |
| 141 | 157 |
| 142 // If true, pass the --https-record-resume argument to testserver.py which | 158 // If true, pass the --https-record-resume argument to testserver.py which |
| 143 // causes it to log session cache actions and echo the log on | 159 // causes it to log session cache actions and echo the log on |
| 144 // /ssl-session-cache. | 160 // /ssl-session-cache. |
| 145 bool record_resume; | 161 bool record_resume; |
| 146 | 162 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 158 // Temporary glue for testing: validation of SCTs is application-controlled | 174 // Temporary glue for testing: validation of SCTs is application-controlled |
| 159 // and can be appropriately mocked out, so sending fake data here does not | 175 // and can be appropriately mocked out, so sending fake data here does not |
| 160 // affect handshaking behaviour. | 176 // affect handshaking behaviour. |
| 161 // TODO(ekasper): replace with valid SCT files for test certs. | 177 // TODO(ekasper): replace with valid SCT files for test certs. |
| 162 // (Fake) SignedCertificateTimestampList (as a raw binary string) to send in | 178 // (Fake) SignedCertificateTimestampList (as a raw binary string) to send in |
| 163 // a TLS extension. | 179 // a TLS extension. |
| 164 std::string signed_cert_timestamps_tls_ext; | 180 std::string signed_cert_timestamps_tls_ext; |
| 165 | 181 |
| 166 // Whether to staple the OCSP response. | 182 // Whether to staple the OCSP response. |
| 167 bool staple_ocsp_response; | 183 bool staple_ocsp_response; |
| 184 | |
| 185 // Whether to enable NPN support. | |
| 186 bool support_npn; | |
|
wtc
2014/04/02 19:26:55
Nit: support_npn => enable_npn?
Ryan Sleevi
2014/04/02 22:09:13
+1
davidben
2014/04/03 19:38:36
Done.
| |
| 168 }; | 187 }; |
| 169 | 188 |
| 170 // Pass as the 'host' parameter during construction to server on 127.0.0.1 | 189 // Pass as the 'host' parameter during construction to server on 127.0.0.1 |
| 171 static const char kLocalhost[]; | 190 static const char kLocalhost[]; |
| 172 | 191 |
| 173 // Initialize a TestServer listening on a specific host (IP or hostname). | 192 // Initialize a TestServer listening on a specific host (IP or hostname). |
| 174 BaseTestServer(Type type, const std::string& host); | 193 BaseTestServer(Type type, const std::string& host); |
| 175 | 194 |
| 176 // Initialize a TestServer with a specific set of SSLOptions for HTTPS or WSS. | 195 // Initialize a TestServer with a specific set of SSLOptions for HTTPS or WSS. |
| 177 BaseTestServer(Type type, const SSLOptions& ssl_options); | 196 BaseTestServer(Type type, const SSLOptions& ssl_options); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 bool log_to_console_; | 290 bool log_to_console_; |
| 272 | 291 |
| 273 scoped_ptr<ScopedPortException> allowed_port_; | 292 scoped_ptr<ScopedPortException> allowed_port_; |
| 274 | 293 |
| 275 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); | 294 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); |
| 276 }; | 295 }; |
| 277 | 296 |
| 278 } // namespace net | 297 } // namespace net |
| 279 | 298 |
| 280 #endif // NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ | 299 #endif // NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ |
| OLD | NEW |