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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // OCSPStatus enumerates the types of OCSP response that the testserver | 79 // OCSPStatus enumerates the types of OCSP response that the testserver |
80 // can produce. | 80 // can produce. |
81 enum OCSPStatus { | 81 enum OCSPStatus { |
82 OCSP_OK, | 82 OCSP_OK, |
83 OCSP_REVOKED, | 83 OCSP_REVOKED, |
84 OCSP_INVALID, | 84 OCSP_INVALID, |
85 OCSP_UNAUTHORIZED, | 85 OCSP_UNAUTHORIZED, |
86 OCSP_UNKNOWN, | 86 OCSP_UNKNOWN, |
87 }; | 87 }; |
88 | 88 |
| 89 // OCSPDate enumerates the date ranges for OCSP responses that the |
| 90 // testserver can produce |
| 91 enum OCSPDate { |
| 92 OCSP_VALID, |
| 93 OCSP_OLD, |
| 94 OCSP_EARLY, |
| 95 OCSP_LONG, |
| 96 }; |
| 97 |
89 // Bitmask of key exchange algorithms that the test server supports and that | 98 // Bitmask of key exchange algorithms that the test server supports and that |
90 // can be selectively enabled or disabled. | 99 // can be selectively enabled or disabled. |
91 enum KeyExchange { | 100 enum KeyExchange { |
92 // Special value used to indicate that any algorithm the server supports | 101 // Special value used to indicate that any algorithm the server supports |
93 // is acceptable. Preferred over explicitly OR-ing all key exchange | 102 // is acceptable. Preferred over explicitly OR-ing all key exchange |
94 // algorithms. | 103 // algorithms. |
95 KEY_EXCHANGE_ANY = 0, | 104 KEY_EXCHANGE_ANY = 0, |
96 | 105 |
97 KEY_EXCHANGE_RSA = (1 << 0), | 106 KEY_EXCHANGE_RSA = (1 << 0), |
98 KEY_EXCHANGE_DHE_RSA = (1 << 1), | 107 KEY_EXCHANGE_DHE_RSA = (1 << 1), |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 ~SSLOptions(); | 153 ~SSLOptions(); |
145 | 154 |
146 // Returns the relative filename of the file that contains the | 155 // Returns the relative filename of the file that contains the |
147 // |server_certificate|. | 156 // |server_certificate|. |
148 base::FilePath GetCertificateFile() const; | 157 base::FilePath GetCertificateFile() const; |
149 | 158 |
150 // GetOCSPArgument returns the value of any OCSP argument to testserver or | 159 // GetOCSPArgument returns the value of any OCSP argument to testserver or |
151 // the empty string if there is none. | 160 // the empty string if there is none. |
152 std::string GetOCSPArgument() const; | 161 std::string GetOCSPArgument() const; |
153 | 162 |
| 163 // GetOCSPArgument returns the value of the OCSP date argument to testserver |
| 164 // or the empty string if there is none. |
| 165 std::string GetOCSPDateArgument() const; |
| 166 |
154 // The certificate to use when serving requests. | 167 // The certificate to use when serving requests. |
155 ServerCertificate server_certificate; | 168 ServerCertificate server_certificate; |
156 | 169 |
157 // If |server_certificate==CERT_AUTO| then this determines the type of OCSP | 170 // If |server_certificate==CERT_AUTO| then this determines the type of OCSP |
158 // response returned. | 171 // response returned. |
159 OCSPStatus ocsp_status; | 172 OCSPStatus ocsp_status; |
160 | 173 |
| 174 // If |server_certificate==CERT_AUTO| then this determines the date range |
| 175 // set on the OCSP response returned. |
| 176 OCSPDate ocsp_date; |
| 177 |
161 // If not zero, |cert_serial| will be the serial number of the | 178 // If not zero, |cert_serial| will be the serial number of the |
162 // auto-generated leaf certificate when |server_certificate==CERT_AUTO|. | 179 // auto-generated leaf certificate when |server_certificate==CERT_AUTO|. |
163 uint64_t cert_serial; | 180 uint64_t cert_serial; |
164 | 181 |
165 // True if a CertificateRequest should be sent to the client during | 182 // True if a CertificateRequest should be sent to the client during |
166 // handshaking. | 183 // handshaking. |
167 bool request_client_certificate; | 184 bool request_client_certificate; |
168 | 185 |
169 // If |request_client_certificate| is true, an optional list of files, | 186 // If |request_client_certificate| is true, an optional list of files, |
170 // each containing a single, PEM-encoded X.509 certificates. The subject | 187 // each containing a single, PEM-encoded X.509 certificates. The subject |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 bool no_anonymous_ftp_user_; | 381 bool no_anonymous_ftp_user_; |
365 | 382 |
366 std::unique_ptr<ScopedPortException> allowed_port_; | 383 std::unique_ptr<ScopedPortException> allowed_port_; |
367 | 384 |
368 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); | 385 DISALLOW_COPY_AND_ASSIGN(BaseTestServer); |
369 }; | 386 }; |
370 | 387 |
371 } // namespace net | 388 } // namespace net |
372 | 389 |
373 #endif // NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ | 390 #endif // NET_TEST_SPAWNED_TEST_SERVER_BASE_TEST_SERVER_H_ |
OLD | NEW |