Move OpenSSL locking code out of SSLContext
authorMingtao Yang <mingtao@fb.com>
Tue, 25 Jul 2017 18:52:40 +0000 (11:52 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 25 Jul 2017 19:16:08 +0000 (12:16 -0700)
commit409667068c1dbbac5e453fc80a316d777f2caae9
treedf47454999f1022cee6972963c10487fe485523b
parentd1ddabb086a2a605b6fa4f95d7b3f72b7865d48b
Move OpenSSL locking code out of SSLContext

Summary:
OpenSSL 1.1.0 deprecates the callback based locking setup in favor
for platform native mutexes.

Added `OPENSSL_init_ssl` in the OpenSSL portability module for OpenSSL API < 1.1.0. This implements
the standard OpenSSL library initialization routines (taken from SSLContext::initializeOpenSSL).

Added `OPENSSL_cleanup` in the OpenSSL portability module for OpenSSL API < 1.1.0. This implements
the cleanup routine from SSLContext::cleanupOpenSSL.

Removed `SSLContext::SSLLockType`. Replaced with `folly::ssl::LockType`.

Reviewed By: mzlee, ngoyal

Differential Revision: D5404777

fbshipit-source-id: 7e5d9bf4a6683afb5560ada0a5b73cac3ff2662b
14 files changed:
folly/Makefile.am
folly/io/async/SSLContext.cpp
folly/io/async/SSLContext.h
folly/io/async/test/AsyncSSLSocketTest2.cpp
folly/io/async/test/AsyncSocketExceptionTest.cpp
folly/io/async/test/SSLContextInitializationTest.cpp [new file with mode: 0644]
folly/portability/OpenSSL.cpp
folly/portability/OpenSSL.h
folly/ssl/Init.cpp [new file with mode: 0644]
folly/ssl/Init.h [new file with mode: 0644]
folly/ssl/OpenSSLLockTypes.h [new file with mode: 0644]
folly/ssl/detail/OpenSSLThreading.cpp [new file with mode: 0644]
folly/ssl/detail/OpenSSLThreading.h [new file with mode: 0644]
folly/ssl/test/OpenSSLCertUtilsTest.cpp