In OpenSSL 1.1.0 or above the library will initialize itself automatically. A compatibility macro exists in ssl.h that maps SSL_library_init to OPENSSL_init_ssl, but the symbol is not defined.
Replacing the symbol as in the patch attached works, but then it would not worl with OpenSSL 1.0.2 or below.