diff mbox series

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

Message ID 20200212233943.32333-1-tmatth@videolan.org
State New
Headers show
Series [FFmpeg-devel,1/1] ffmpeg: gnutls: ignore TLS rehandshake requests
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Tristan Matthews Feb. 12, 2020, 11:39 p.m. UTC
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 mbox series

Patch

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;