Summary: We set the actual locks on initialization, so attempting to change locks after had no affect, other than making isSSLLockDisabled() report incorrect information.
Reviewed By: yfeldblum
Differential Revision:
D4935475
fbshipit-source-id:
7b80cd530801c925ade769163579b86b1a8f0027
}
void SSLContext::setSSLLockTypes(std::map<int, SSLLockType> inLockTypes) {
+ if (initialized_) {
+ // We set the locks on initialization, so if we are already initialized
+ // this would have no affect.
+ LOG(INFO) << "Ignoring setSSLLockTypes after initialization";
+ return;
+ }
+
lockTypes() = inLockTypes;
}
#endif
}
+TEST(AsyncSSLSocketTest2, SSLContextLocksSetAfterInitIgnored) {
+ SSLContext::initializeOpenSSL();
+ SSLContext::setSSLLockTypes({});
+#ifdef CRYPTO_LOCK_EVP_PKEY
+ EXPECT_TRUE(SSLContext::isSSLLockDisabled(CRYPTO_LOCK_EVP_PKEY));
+#endif
+}
+
} // folly
int main(int argc, char *argv[]) {