]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_rtp_asterisk: Use latest DTLS version available by underlying platform. 53/3053/2
authorAlexander Traud <pabstraud@compuserve.com>
Tue, 21 Jun 2016 12:05:30 +0000 (14:05 +0200)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 21 Jun 2016 18:25:21 +0000 (13:25 -0500)
Do not use DTLSv1_method() but DTLS_method() when available in OpenSSL of the
underlying platform. This change enables DTLS 1.2 since OpenSSL 1.0.2, for
WebRTC (DTLS-SRTP via SIP-over-WebSockets). This change enables AEAD-based
cipher-suites.

ASTERISK-26130 #close

Change-Id: I41f24448d6d2953e8bdb97c9f4a6bc8a8f055fd0

res/res_rtp_asterisk.c

index 86595a34bfd759e1961ba31ea0073bcd117d668c..36ce1174865d3d805831cf7ff3699e31f976a496 100644 (file)
@@ -1298,7 +1298,12 @@ static int ast_rtp_dtls_set_configuration(struct ast_rtp_instance *instance, con
                return -1;
        }
 
-       if (!(rtp->ssl_ctx = SSL_CTX_new(DTLSv1_method()))) {
+#if OPENSSL_VERSION_NUMBER < 0x10002000L
+       rtp->ssl_ctx = SSL_CTX_new(DTLSv1_method());
+#else
+       rtp->ssl_ctx = SSL_CTX_new(DTLS_method());
+#endif
+       if (!rtp->ssl_ctx) {
                return -1;
        }