Commit 483f7edc authored by Joel Goguen's avatar Joel Goguen Committed by Viswanath Sivakumar

Add static method to skip SSL init

Summary:
Some things like gSOAP, initialize SSL only to have SSLContext stomp over their
work. Add a method to allow flagging SSLContext as "initialized" to use the
existing global state.

Test Plan:
Tested running mcrouter and paymentnegined to verify existing
functionality appears normal.

Reviewed By: subodh@fb.com

Subscribers: ssl-diffs@, folly-diffs@, yfeldblum, chalfant, dihde

FB internal diff: D1959936

Tasks: 6655251

Signature: t1:1959936:1427994292:8b2be1742ef17a5ec2c7b3ad37787d2cf4d142a6
parent 7c9f2635
......@@ -682,6 +682,11 @@ void SSLContext::setSSLLockTypes(std::map<int, SSLLockType> inLockTypes) {
lockTypes() = inLockTypes;
}
void SSLContext::markInitialized() {
std::lock_guard<std::mutex> g(mutex_);
initialized_ = true;
}
void SSLContext::initializeOpenSSL() {
std::lock_guard<std::mutex> g(mutex_);
initializeOpenSSLLocked();
......
......@@ -403,6 +403,13 @@ class SSLContext {
static void initializeOpenSSL();
static void cleanupOpenSSL();
/**
* Mark openssl as initialized without actually performing any initialization.
* Please use this only if you are using a library which requires that it must
* make its own calls to SSL_library_init() and related functions.
*/
static void markInitialized();
/**
* Default randomize method.
*/
......
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