Commit 24cc012a authored by Linus Nordberg's avatar Linus Nordberg

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.
parent 3e3123b5
...@@ -217,7 +217,12 @@ static SSL_CTX *tlscreatectx(uint8_t type, struct tls *conf) { ...@@ -217,7 +217,12 @@ static SSL_CTX *tlscreatectx(uint8_t type, struct tls *conf) {
#endif #endif
#ifdef RADPROT_DTLS #ifdef RADPROT_DTLS
case RAD_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()); ctx = SSL_CTX_new(DTLSv1_method());
#endif
#ifdef DEBUG #ifdef DEBUG
SSL_CTX_set_info_callback(ctx, ssl_info_callback); SSL_CTX_set_info_callback(ctx, ssl_info_callback);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment