| 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 #ifndef NET_TEST_BASE_TEST_SERVER_H_ | 5 #ifndef NET_TEST_BASE_TEST_SERVER_H_ |
| 6 #define NET_TEST_BASE_TEST_SERVER_H_ | 6 #define NET_TEST_BASE_TEST_SERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 BULK_CIPHER_RC4 = (1 << 0), | 78 BULK_CIPHER_RC4 = (1 << 0), |
| 79 BULK_CIPHER_AES128 = (1 << 1), | 79 BULK_CIPHER_AES128 = (1 << 1), |
| 80 BULK_CIPHER_AES256 = (1 << 2), | 80 BULK_CIPHER_AES256 = (1 << 2), |
| 81 | 81 |
| 82 // NOTE: 3DES support in the Python test server has external | 82 // NOTE: 3DES support in the Python test server has external |
| 83 // dependencies and not be available on all machines. Clients may not | 83 // dependencies and not be available on all machines. Clients may not |
| 84 // be able to connect if only 3DES is specified. | 84 // be able to connect if only 3DES is specified. |
| 85 BULK_CIPHER_3DES = (1 << 3), | 85 BULK_CIPHER_3DES = (1 << 3), |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // NOTE: the values of these enumerators are passed to the the Python test |
| 89 // server. Do not change them. |
| 90 enum TLSIntolerantLevel { |
| 91 TLS_INTOLERANT_NONE = 0, |
| 92 TLS_INTOLERANT_ALL = 1, // Intolerant of all TLS versions. |
| 93 TLS_INTOLERANT_TLS1_1 = 2, // Intolerant of TLS 1.1 or higher. |
| 94 TLS_INTOLERANT_TLS1_2 = 3, // Intolerant of TLS 1.2 or higher. |
| 95 }; |
| 96 |
| 88 // Initialize a new HTTPSOptions using CERT_OK as the certificate. | 97 // Initialize a new HTTPSOptions using CERT_OK as the certificate. |
| 89 HTTPSOptions(); | 98 HTTPSOptions(); |
| 90 | 99 |
| 91 // Initialize a new HTTPSOptions that will use the specified certificate. | 100 // Initialize a new HTTPSOptions that will use the specified certificate. |
| 92 explicit HTTPSOptions(ServerCertificate cert); | 101 explicit HTTPSOptions(ServerCertificate cert); |
| 93 ~HTTPSOptions(); | 102 ~HTTPSOptions(); |
| 94 | 103 |
| 95 // Returns the relative filename of the file that contains the | 104 // Returns the relative filename of the file that contains the |
| 96 // |server_certificate|. | 105 // |server_certificate|. |
| 97 FilePath GetCertificateFile() const; | 106 FilePath GetCertificateFile() const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 120 // A bitwise-OR of BulkCipher that should be used by the | 129 // A bitwise-OR of BulkCipher that should be used by the |
| 121 // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented | 130 // HTTPS server, or BULK_CIPHER_ANY to indicate that all implemented |
| 122 // ciphers are acceptable. | 131 // ciphers are acceptable. |
| 123 int bulk_ciphers; | 132 int bulk_ciphers; |
| 124 | 133 |
| 125 // If true, pass the --https-record-resume argument to testserver.py which | 134 // If true, pass the --https-record-resume argument to testserver.py which |
| 126 // causes it to log session cache actions and echo the log on | 135 // causes it to log session cache actions and echo the log on |
| 127 // /ssl-session-cache. | 136 // /ssl-session-cache. |
| 128 bool record_resume; | 137 bool record_resume; |
| 129 | 138 |
| 130 // If true, the server will abort any TLS handshake in order to test | 139 // If not TLS_INTOLERANT_NONE, the server will abort any handshake that |
| 131 // SSLv3 fallback. | 140 // negotiates an intolerant TLS version in order to test version fallback. |
| 132 bool tls_intolerant; | 141 TLSIntolerantLevel tls_intolerant; |
| 133 }; | 142 }; |
| 134 | 143 |
| 135 // Pass as the 'host' parameter during construction to server on 127.0.0.1 | 144 // Pass as the 'host' parameter during construction to server on 127.0.0.1 |
| 136 static const char kLocalhost[]; | 145 static const char kLocalhost[]; |
| 137 | 146 |
| 138 // The auth token to be used for TYPE_GDATA server. | 147 // The auth token to be used for TYPE_GDATA server. |
| 139 static const char kGDataAuthToken[]; | 148 static const char kGDataAuthToken[]; |
| 140 | 149 |
| 141 // Initialize a TestServer listening on a specific host (IP or hostname). | 150 // Initialize a TestServer listening on a specific host (IP or hostname). |
| 142 BaseTestServer(Type type, const std::string& host); | 151 BaseTestServer(Type type, const std::string& host); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 237 |
| 229 scoped_ptr<ScopedPortException> allowed_port_; | 238 scoped_ptr<ScopedPortException> allowed_port_; |
| 230 | 239 |
| 231 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); | 240 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); |
| 232 }; | 241 }; |
| 233 | 242 |
| 234 } // namespace net | 243 } // namespace net |
| 235 | 244 |
| 236 #endif // NET_TEST_BASE_TEST_SERVER_H_ | 245 #endif // NET_TEST_BASE_TEST_SERVER_H_ |
| 237 | 246 |
| OLD | NEW |