From e7e0a5d4af78f7585bf7eebba04d194c0703d286 Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Sat, 22 Jun 2019 09:35:03 +0800 Subject: [PATCH] Fix openssl version issue --- src/dns_client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dns_client.c b/src/dns_client.c index 733156b..10ca77a 100644 --- a/src/dns_client.c +++ b/src/dns_client.c @@ -752,7 +752,11 @@ static int _dns_client_server_add(char *server_ip, char *server_host, int port, /* if server type is TLS, create ssl context */ if (server_type == DNS_SERVER_TLS || server_type == DNS_SERVER_HTTPS) { +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) server_info->ssl_ctx = SSL_CTX_new(TLS_client_method()); +#else + server_info->ssl_ctx = SSL_CTX_new(SSLv23_client_method()); +#endif if (server_info->ssl_ctx == NULL) { tlog(TLOG_ERROR, "init ssl failed."); goto errout;