From 69027c1090ab9e8a63fab7114854a23a0b6a36b5 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sun, 6 Mar 2016 23:18:21 +0100 Subject: Use DTLS_method() for new SSL context if it exists. Effectively turning on support for DTLS 1.2 when OpenSSL version 1.0.2 or higher. --- tlscommon.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tlscommon.c b/tlscommon.c index ee81d71..157296b 100644 --- a/tlscommon.c +++ b/tlscommon.c @@ -218,7 +218,12 @@ static SSL_CTX *tlscreatectx(uint8_t type, struct tls *conf) { #endif #ifdef RADPROT_DTLS case RAD_DTLS: +#if OPENSSL_VERSION_NUMBER >= 0x10002000 + /* DTLS_method() seems to have been introduced in OpenSSL 1.0.2. */ + ctx = SSL_CTX_new(DTLS_method()); +#else ctx = SSL_CTX_new(DTLSv1_method()); +#endif #ifdef DEBUG SSL_CTX_set_info_callback(ctx, ssl_info_callback); #endif -- cgit v1.1