From 7ba9db37446b3c0acf2449dd26e210235f7666af Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 15 Jun 2022 00:28:12 -0700 Subject: [PATCH] obs-outputs: Reset TLS on reconnect Reverts e8b2b2092bd3e and properly fixes an issue where bad TLS data would persist through reconnections when the connection is encrypted. --- plugins/obs-outputs/rtmp-stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/obs-outputs/rtmp-stream.c b/plugins/obs-outputs/rtmp-stream.c index ca1919a7a..4df12a33d 100644 --- a/plugins/obs-outputs/rtmp-stream.c +++ b/plugins/obs-outputs/rtmp-stream.c @@ -1041,9 +1041,12 @@ static int try_connect(struct rtmp_stream *stream) // on reconnect we need to reset the internal variables of librtmp // otherwise the data sent/received will not parse correctly on the other end - memset(&stream->rtmp, 0, sizeof(stream->rtmp)); RTMP_Reset(&stream->rtmp); + // apparently TLS will not properly persist through connections + RTMP_TLS_Free(&stream->rtmp); + RTMP_TLS_Init(&stream->rtmp); + // since we don't call RTMP_Init above, there's no other good place // to reset this as doing it in RTMP_Close breaks the ugly RTMP // authentication system