Skip to content

Commit

Permalink
Recommended cipher list for server side.
Browse files Browse the repository at this point in the history
Summary: A SSLOptions recommended for cipher use.

Reviewed By: yfeldblum

Differential Revision: D5614280

fbshipit-source-id: a6b1adfa8d168f35c7bc7d4088c4073c3f4084a5
  • Loading branch information
xybu authored and facebook-github-bot committed Aug 19, 2017
1 parent 0e0710e commit f2ddd0e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions folly/io/async/SSLOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void logDfatal(std::exception const& e) {

constexpr std::array<const char*, 12> SSLCommonOptions::kCipherList;
constexpr std::array<const char*, 8> SSLCommonOptions::kSignatureAlgorithms;
constexpr std::array<const char*, 12> SSLServerOptions::kCipherList;

void SSLCommonOptions::setClientOptions(SSLContext& ctx) {
#ifdef SSL_MODE_HANDSHAKE_CUTTHROUGH
Expand Down
22 changes: 22 additions & 0 deletions folly/io/async/SSLOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,28 @@ struct SSLCommonOptions {
static void setClientOptions(SSLContext& ctx);
};

/**
* Recommended SSL options for server-side scenario.
*/
struct SSLServerOptions {
/**
* The list of ciphers recommended for server use.
*/
static constexpr auto kCipherList = folly::make_array(
"ECDHE-ECDSA-AES128-GCM-SHA256",
"ECDHE-ECDSA-AES256-GCM-SHA384",
"ECDHE-ECDSA-AES128-SHA",
"ECDHE-ECDSA-AES256-SHA",
"ECDHE-RSA-AES128-GCM-SHA256",
"ECDHE-RSA-AES256-GCM-SHA384",
"ECDHE-RSA-AES128-SHA",
"ECDHE-RSA-AES256-SHA",
"AES128-GCM-SHA256",
"AES256-GCM-SHA384",
"AES128-SHA",
"AES256-SHA");
};

/**
* Set the cipher suite of ctx to that in TSSLOptions, and print any runtime
* error it catches.
Expand Down

0 comments on commit f2ddd0e

Please sign in to comment.