Ignore setSSLLockTypes() calls after SSLContext is initialized.
[folly.git] / folly / io / async / test / AsyncSSLSocketTest2.cpp
index bd85d533706d949a6330c2c79556cfe96499d2aa..54454c9fbbaf75a7eb376926608e7485c955fde7 100644 (file)
@@ -205,6 +205,14 @@ TEST(AsyncSSLSocketTest2, SSLContextLocks) {
 #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[]) {