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