[FFmpeg-devel] [PATCH 1/1] ffmpeg: gnutls: ignore TLS rehandshake requests

Tristan Matthews tmatth at videolan.org
Thu Feb 13 01:39:43 EET 2020


Log a warning instead of terminating.

TLS does not explicitly require that the client initiate the handshake when
requested by the server, it can be ignored (although the server is free to
break the connection if no handshake is forthcoming).

https://www.gnutls.org/manual/html_node/Core-TLS-API.html#gnutls_005frehandshake
---
 libavformat/tls_gnutls.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index f32bc2821b..db9d50b586 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -81,6 +81,9 @@ static int print_tls_error(URLContext *h, int ret)
     case GNUTLS_E_PREMATURE_TERMINATION:
 #endif
         break;
+    case GNUTLS_E_REHANDSHAKE:
+        av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));
+        return 0;
     case GNUTLS_E_WARNING_ALERT_RECEIVED:
         av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));
         break;
-- 
2.20.1



More information about the ffmpeg-devel mailing list