]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn-ssl.c
Fix compilation without deprecated OpenSSL APIs (#252)
[ngircd-alex.git] / src / ngircd / conn-ssl.c
index be6ee0a8f9490be9dd5a15976d483ab0d9a850d0..ba47e513603b69aba08f2b7cf25f6c20a1ad4555 100644 (file)
@@ -42,6 +42,7 @@ extern struct SSLOptions Conf_SSLOptions;
 #ifdef HAVE_LIBSSL
 #include <openssl/err.h>
 #include <openssl/rand.h>
+#include <openssl/dh.h>
 
 static SSL_CTX * ssl_ctx;
 static DH *dh_params;
@@ -283,10 +284,12 @@ ConnSSL_InitLibrary( void )
 #ifdef HAVE_LIBSSL
        SSL_CTX *newctx;
 
+#if OPENSSL_API_COMPAT < 0x10100000L
        if (!ssl_ctx) {
                SSL_library_init();
                SSL_load_error_strings();
        }
+#endif
 
        if (!RAND_status()) {
                Log(LOG_ERR, "OpenSSL PRNG not seeded: /dev/urandom missing?");
@@ -324,7 +327,7 @@ ConnSSL_InitLibrary( void )
                           Verify_openssl);
        SSL_CTX_free(ssl_ctx);
        ssl_ctx = newctx;
-       Log(LOG_INFO, "%s initialized.", SSLeay_version(SSLEAY_VERSION));
+       Log(LOG_INFO, "%s initialized.", OpenSSL_version(OPENSSL_VERSION));
        return true;
 out:
        SSL_CTX_free(newctx);
@@ -745,7 +748,7 @@ ConnSSL_InitCertFp( CONNECTION *c )
                gnutls_x509_crt_deinit(cert);
                return 0;
        }
-       
+
        if (gnutls_x509_crt_import(cert, &cert_list[0],
                                   GNUTLS_X509_FMT_DER) != GNUTLS_E_SUCCESS) {
                gnutls_x509_crt_deinit(cert);
@@ -912,5 +915,3 @@ ConnSSL_InitLibrary(void)
 
 #endif /* SSL_SUPPORT */
 /* -eof- */
-
-