From 1186236ac11d959bd7b2af5c53db065f3aa3da13 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sun, 23 Oct 2016 01:08:13 -0400 Subject: ssl: Fix building with older OpenSSL too --- src/common/ssl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/common/ssl.c b/src/common/ssl.c index 31b3062e..ad83d070 100644 --- a/src/common/ssl.c +++ b/src/common/ssl.c @@ -294,14 +294,20 @@ SSL * _SSL_socket (SSL_CTX *ctx, int sd) { SSL *ssl; - + const SSL_METHOD *method; if (!(ssl = SSL_new (ctx))) /* FATAL */ __SSL_critical_error ("SSL_new"); SSL_set_fd (ssl, sd); - if (SSL_CTX_get_ssl_method (ctx) == SSLv23_client_method()) + +#if OPENSSL_VERSION_NUMBER < 0x10100000L + method = ctx->method; +#else + method = SSL_CTX_get_ssl_method (ctx); +#endif + if (method == SSLv23_client_method()) SSL_set_connect_state (ssl); else SSL_set_accept_state(ssl); -- cgit 1.4.1