Fix OpenSSL 1.1 compatibility

This commit is contained in:
Přemysl Eric Janouch 2017-01-25 18:06:42 +01:00
parent 72a7cbdb1f
commit 66f1a6afa3
Signed by: p
GPG Key ID: B715679E3A361BE6
2 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,8 @@ set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package (Curses) find_package (Curses)
find_package (PkgConfig REQUIRED) find_package (PkgConfig REQUIRED)
pkg_check_modules (dependencies REQUIRED libcurl jansson) pkg_check_modules (dependencies REQUIRED libcurl jansson)
# Note that cURL can link to a different version of libssl than we do,
# in which case the results are undefined
pkg_check_modules (libssl REQUIRED libssl libcrypto) pkg_check_modules (libssl REQUIRED libssl libcrypto)
find_package (LibEV REQUIRED) find_package (LibEV REQUIRED)
pkg_check_modules (ncursesw ncursesw) pkg_check_modules (ncursesw ncursesw)

View File

@ -2241,10 +2241,15 @@ backend_ws_new (struct app_context *ctx,
self->endpoint = xstrdup (endpoint); self->endpoint = xstrdup (endpoint);
self->url = *url; self->url = *url;
#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER
SSL_library_init (); SSL_library_init ();
atexit (EVP_cleanup); atexit (EVP_cleanup);
SSL_load_error_strings (); SSL_load_error_strings ();
atexit (ERR_free_strings); atexit (ERR_free_strings);
#else
// Cleanup is done automatically via atexit()
OPENSSL_init_ssl (0, NULL);
#endif
return &self->super; return &self->super;
} }