diff mbox

[FFmpeg-devel] GnuTLS: eat PREMATURE_TERMINATION error

Message ID CANqewP2pY7simR4xo0y3woWOOsr2n9EquetNhG4Xp-pUjVkSLw@mail.gmail.com
State Accepted
Commit 598e41684066feba701d19ca7443d24b9e5efa77
Headers show

Commit Message

Tatsuyuki Ishi Sept. 15, 2017, 8:04 a.m. UTC
Subject: [PATCH] GnuTLS: eat PREMATURE_TERMINATION error

GnuTLS is too strict on the SSL shutdown alert, and it's neither
mandatory in the spec or critical. As it's ignored in OpenSSL, we
should also suppress it in GnuTLS as well.

Ticket: #6667

---
 libavformat/tls_gnutls.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jan Ekström Sept. 15, 2017, 3:06 p.m. UTC | #1
Hi,

On Fri, Sep 15, 2017 at 11:04 AM, Tatsuyuki Ishi
<ishitatsuyuki@gmail.com> wrote:
> Subject: [PATCH] GnuTLS: eat PREMATURE_TERMINATION error
>
> GnuTLS is too strict on the SSL shutdown alert, and it's neither
> mandatory in the spec or critical. As it's ignored in OpenSSL, we
> should also suppress it in GnuTLS as well.
>

If anyone wants to test this, Youtube is a good example of this
message getting spammed. If we ignore this with OpenSSL as well, then
I totally agree with this change.


Jan
wm4 Sept. 19, 2017, 7:14 p.m. UTC | #2
On Fri, 15 Sep 2017 17:04:38 +0900
Tatsuyuki Ishi <ishitatsuyuki@gmail.com> wrote:

> Subject: [PATCH] GnuTLS: eat PREMATURE_TERMINATION error
> 
> GnuTLS is too strict on the SSL shutdown alert, and it's neither
> mandatory in the spec or critical. As it's ignored in OpenSSL, we
> should also suppress it in GnuTLS as well.
> 
> Ticket: #6667
> 
> ---
>  libavformat/tls_gnutls.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
> index ecc80bf..38f8ea4 100644
> --- a/libavformat/tls_gnutls.c
> +++ b/libavformat/tls_gnutls.c
> @@ -72,6 +72,7 @@ static int print_tls_error(URLContext *h, int ret)
>      switch (ret) {
>      case GNUTLS_E_AGAIN:
>      case GNUTLS_E_INTERRUPTED:
> +    case GNUTLS_E_PREMATURE_TERMINATION:
>          break;
>      case GNUTLS_E_WARNING_ALERT_RECEIVED:
>          av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));

I also agree with this patch.
Michael Niedermayer Sept. 20, 2017, 8:45 p.m. UTC | #3
On Tue, Sep 19, 2017 at 09:14:58PM +0200, wm4 wrote:
> On Fri, 15 Sep 2017 17:04:38 +0900
> Tatsuyuki Ishi <ishitatsuyuki@gmail.com> wrote:
> 
> > Subject: [PATCH] GnuTLS: eat PREMATURE_TERMINATION error
> > 
> > GnuTLS is too strict on the SSL shutdown alert, and it's neither
> > mandatory in the spec or critical. As it's ignored in OpenSSL, we
> > should also suppress it in GnuTLS as well.
> > 
> > Ticket: #6667
> > 
> > ---
> >  libavformat/tls_gnutls.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
> > index ecc80bf..38f8ea4 100644
> > --- a/libavformat/tls_gnutls.c
> > +++ b/libavformat/tls_gnutls.c
> > @@ -72,6 +72,7 @@ static int print_tls_error(URLContext *h, int ret)
> >      switch (ret) {
> >      case GNUTLS_E_AGAIN:
> >      case GNUTLS_E_INTERRUPTED:
> > +    case GNUTLS_E_PREMATURE_TERMINATION:
> >          break;
> >      case GNUTLS_E_WARNING_ALERT_RECEIVED:
> >          av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));
> 
> I also agree with this patch.

will apply after some basic testing

thanks

[...]
diff mbox

Patch

diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index ecc80bf..38f8ea4 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -72,6 +72,7 @@  static int print_tls_error(URLContext *h, int ret)
     switch (ret) {
     case GNUTLS_E_AGAIN:
     case GNUTLS_E_INTERRUPTED:
+    case GNUTLS_E_PREMATURE_TERMINATION:
         break;
     case GNUTLS_E_WARNING_ALERT_RECEIVED:
         av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));