Commit 4eae85a8 authored by Jun Zhao's avatar Jun Zhao

lavf/tls_openssl: support both pre-1.1.0 and post-1.1.0 init

supporting both pre-1.1.0 and post-1.1.0 version of the OpenSSL
library as the link:
https://wiki.openssl.org/index.php/Library_InitializationSigned-off-by: 's avatarJun Zhao <barryjzhao@tencent.com>
parent e3c732bb
...@@ -70,8 +70,15 @@ int ff_openssl_init(void) ...@@ -70,8 +70,15 @@ int ff_openssl_init(void)
{ {
ff_lock_avformat(); ff_lock_avformat();
if (!openssl_init) { if (!openssl_init) {
/* OpenSSL 1.0.2 or below, then you would use SSL_library_init. If you are
* using OpenSSL 1.1.0 or above, then the library will initialize
* itself automatically.
* https://wiki.openssl.org/index.php/Library_Initialization
*/
#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_library_init(); SSL_library_init();
SSL_load_error_strings(); SSL_load_error_strings();
#endif
#if HAVE_THREADS #if HAVE_THREADS
if (!CRYPTO_get_locking_callback()) { if (!CRYPTO_get_locking_callback()) {
int i; int i;
......
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