]> git.kaiwu.me - nginx.git/commitdiff
SSL: SSLeay_version() is deprecated in OpenSSL 1.1.0.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 31 Mar 2016 20:38:38 +0000 (23:38 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 31 Mar 2016 20:38:38 +0000 (23:38 +0300)
SSLeay_version() and SSLeay() are no longer available if OPENSSL_API_COMPAT
is set to 0x10100000L.  Switched to using OpenSSL_version() instead.

Additionally, we now compare version strings instead of version numbers,
and this correctly works for LibreSSL as well.

src/core/nginx.c
src/event/ngx_event_openssl.h

index e69acb57126b9a1ee6bff613f66b4f66b940d488..60f8fe7d47d7d3d9fb1c0a1043333113dc58353c 100644 (file)
@@ -413,13 +413,12 @@ ngx_show_version_info(void)
 #endif
 
 #if (NGX_SSL)
-        if (SSLeay() == SSLEAY_VERSION_NUMBER) {
+        if (ngx_strcmp(ngx_ssl_version(), OPENSSL_VERSION_TEXT) == 0) {
             ngx_write_stderr("built with " OPENSSL_VERSION_TEXT NGX_LINEFEED);
         } else {
             ngx_write_stderr("built with " OPENSSL_VERSION_TEXT
                              " (running with ");
-            ngx_write_stderr((char *) (uintptr_t)
-                             SSLeay_version(SSLEAY_VERSION));
+            ngx_write_stderr((char *) (uintptr_t) ngx_ssl_version());
             ngx_write_stderr(")" NGX_LINEFEED);
         }
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
index 8ad87bbfae4d71e1b2f6d184eb806de1028a216d..09654dbd33bf101e9fd87460d6bf33fcb758766c 100644 (file)
 #endif
 
 
+#if (OPENSSL_VERSION_NUMBER >= 0x10100001L)
+
+#define ngx_ssl_version()       OpenSSL_version(OPENSSL_VERSION)
+
+#else
+
+#define ngx_ssl_version()       SSLeay_version(SSLEAY_VERSION)
+
+#endif
+
+
 #define ngx_ssl_session_t       SSL_SESSION
 #define ngx_ssl_conn_t          SSL