Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: net/ssl/ssl_server_config.h

Issue 1376593007: SSL in EmbeddedTestServer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More cleanup. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/ssl/ssl_server_config.h
diff --git a/net/ssl/ssl_server_config.h b/net/ssl/ssl_server_config.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f8aca468404062dc07f65bf6a4e1f7311a59102
--- /dev/null
+++ b/net/ssl/ssl_server_config.h
@@ -0,0 +1,84 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_SSL_SSL_SERVER_CONFIG_H_
+#define NET_SSL_SSL_SERVER_CONFIG_H_
+
+#include "base/basictypes.h"
+#include "net/base/net_export.h"
+#include "net/ssl/ssl_config.h"
+
+namespace net {
+
+// A collection of server-side SSL-related configuration settings.
+struct NET_EXPORT SSLServerConfig {
+ // Defaults
+ SSLServerConfig();
+ ~SSLServerConfig();
+
+ enum ServerCertificate {
mmenke 2015/10/14 21:59:15 Suggest putting the enum above the constructor. T
svaldez 2015/10/14 22:33:39 Done.
+ CERT_OK,
+
+ CERT_MISMATCHED_NAME,
+ CERT_EXPIRED,
+
+ // A certificate with invalid notBefore and notAfter times. Windows'
+ // certificate library will not parse this certificate.
+ CERT_BAD_VALIDITY,
+
+ // Cross-signed certificate to test PKIX path building. Contains an
+ // intermediate cross-signed by an unknown root, while the client (via
+ // TestRootStore) is expected to have a self-signed version of the
+ // intermediate.
+ CERT_CHAIN_WRONG_ROOT,
+
+ // Causes the testserver to use a hostname that is a domain
+ // instead of an IP.
+ CERT_COMMON_NAME_IS_DOMAIN,
+ };
+
+ // The minimum and maximum protocol versions that are enabled.
+ // (Use the SSL_PROTOCOL_VERSION_xxx enumerators defined in ssl_config.)
+ // SSL 2.0 and SSL 3.0 are not supported. If version_max < version_min, it
+ // means no protocol versions are enabled.
+ uint16_t version_min;
+ uint16_t version_max;
mmenke 2015/10/14 21:59:15 include <stdint.h>
svaldez 2015/10/14 22:33:39 Done.
+
+ // Presorted list of cipher suites which should be explicitly prevented from
+ // being used in addition to those disabled by the net built-in policy.
+ //
+ // By default, all cipher suites supported by the underlying SSL
+ // implementation will be enabled except for:
+ // - Null encryption cipher suites.
+ // - Weak cipher suites: < 80 bits of security strength.
+ // - FORTEZZA cipher suites (obsolete).
+ // - IDEA cipher suites (RFC 5469 explains why).
+ // - Anonymous cipher suites.
+ // - ECDSA cipher suites on platforms that do not support ECDSA signed
+ // certificates, as servers may use the presence of such ciphersuites as a
+ // hint to send an ECDSA certificate.
+ // The ciphers listed in |disabled_cipher_suites| will be removed in addition
+ // to the above list.
+ //
+ // Though cipher suites are sent in TLS as "uint8 CipherSuite[2]", in
+ // big-endian form, they should be declared in host byte order, with the
+ // first uint8 occupying the most significant byte.
+ // Ex: To disable TLS_RSA_WITH_RC4_128_MD5, specify 0x0004, while to
+ // disable TLS_ECDH_ECDSA_WITH_RC4_128_SHA, specify 0xC002.
+ std::vector<uint16> disabled_cipher_suites;
mmenke 2015/10/14 21:59:15 uint16_t (Like you're using above) is the latest c
mmenke 2015/10/14 21:59:15 include <vector>
svaldez 2015/10/14 22:33:39 Done.
svaldez 2015/10/14 22:33:39 Done.
+
+ // If true, causes only ECDHE cipher suites to be enabled.
+ bool require_ecdhe;
+
+ // Requires a client certificate for client authentication from the client.
+ // This doesn't currently enforce certificate validity.
+ bool require_client_cert;
+
+ // The certificate kind to use when serving requests.
+ ServerCertificate server_cert;
+};
+
+} // namespace net
+
+#endif // NET_SSL_SSL_SERVER_CONFIG_H_

Powered by Google App Engine
This is Rietveld 408576698