Commit 4156360f authored by Neel Goyal's avatar Neel Goyal Committed by Facebook Github Bot

Ensure SSL is initialized in getOpenSSLCipherNames

Summary: SSL_CTX_new can fail if OpenSSL is not initialized.  This ensures it is.

Reviewed By: bolekk

Differential Revision: D10105302

fbshipit-source-id: 4da40d4714747b0e6a359a52fa594fc29bb93c0a
parent f43ce6d6
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/portability/Sockets.h> #include <folly/portability/Sockets.h>
#include <folly/portability/Unistd.h> #include <folly/portability/Unistd.h>
#include <folly/ssl/Init.h>
namespace { namespace {
#ifdef OPENSSL_IS_BORINGSSL #ifdef OPENSSL_IS_BORINGSSL
...@@ -149,6 +150,7 @@ bool OpenSSLUtils::validatePeerCertNames( ...@@ -149,6 +150,7 @@ bool OpenSSLUtils::validatePeerCertNames(
} }
static std::unordered_map<uint16_t, std::string> getOpenSSLCipherNames() { static std::unordered_map<uint16_t, std::string> getOpenSSLCipherNames() {
folly::ssl::init();
std::unordered_map<uint16_t, std::string> ret; std::unordered_map<uint16_t, std::string> ret;
SSL_CTX* ctx = nullptr; SSL_CTX* ctx = nullptr;
SSL* ssl = nullptr; SSL* ssl = nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment