--- a/src/gateway.c
+++ b/src/gateway.c
@@ -78,10 +78,14 @@ openssl_init(void)
 	ERR_load_crypto_strings();
 	SSL_load_error_strings();
 	OpenSSL_add_all_algorithms();
-#endif
 	debug (LOG_DEBUG, "Using OpenSSL version \"%s\"\nand libevent version \"%s\"\n",
 		  SSLeay_version (SSLEAY_VERSION),
 		  event_get_version ());
+#else
+	debug (LOG_DEBUG, "Using OpenSSL version \"%s\"\nand libevent version \"%s\"\n",
+		  OpenSSL_version (OPENSSL_VERSION),
+		  event_get_version ());
+#endif
 }
 
 static void
