summaryrefslogtreecommitdiff
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2016-06-21 14:05:30 +0200
committerRichard Mudgett <rmudgett@digium.com>2016-06-21 13:24:56 -0500
commitef97911a1c0f380d17df3b92c9b5805dd3dbd6b5 (patch)
tree8b10c52c59da4e6ebeceaeaa43b4330ad87a6cc3 /res/res_rtp_asterisk.c
parentb0e71c6571ec34a1aa115ce0ba26f7e37f487eaa (diff)
res_rtp_asterisk: Use latest DTLS version available by underlying platform.
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
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index b2ecf5962..7665b5cc0 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1357,7 +1357,12 @@ static int ast_rtp_dtls_set_configuration(struct ast_rtp_instance *instance, con
return 0;
}
- 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;
}