diff options
author | Patrick Griffis <tingping@tingping.se> | 2016-10-23 01:08:13 -0400 |
---|---|---|
committer | Patrick Griffis <tingping@tingping.se> | 2016-10-23 01:09:27 -0400 |
commit | 1186236ac11d959bd7b2af5c53db065f3aa3da13 (patch) | |
tree | 0c200dabc60143feaa479ba7ef57829b198bb039 /src | |
parent | 217fa9d0f9fe21d998672fd72c547ee68dfe1aac (diff) |
ssl: Fix building with older OpenSSL too
Diffstat (limited to 'src')
-rw-r--r-- | src/common/ssl.c | 10 |
1 files changed, 8 insertions, 2 deletions
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); |