Message ID | DU0PR03MB956764A45A25B9AAA59C0FBDECEE2@DU0PR03MB9567.eurprd03.prod.outlook.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/6] lavf/tls_mbedtls: handle more error codes for human-readable message | expand |
Context | Check | Description |
---|---|---|
yinshiyou/configure_loongarch64 | warning | Failed to apply patch |
andriy/configure_x86 | warning | Failed to apply patch |
On Fri, May 17, 2024 at 10:34:26AM +0200, Sfan5 wrote: > Signed-off-by: sfan5 <sfan5@live.de> > --- > libavformat/tls_mbedtls.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c > index 1a182e735e..fd6ba0b1f5 100644 > --- a/libavformat/tls_mbedtls.c > +++ b/libavformat/tls_mbedtls.c > @@ -138,6 +138,9 @@ static void handle_handshake_error(URLContext *h, int > ret) > case MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE: > av_log(h, AV_LOG_ERROR, "TLS handshake failed.\n"); > break; > + case MBEDTLS_ERR_SSL_BAD_PROTOCOL_VERSION: > + av_log(h, AV_LOG_ERROR, "TLS protocol version mismatches.\n"); "... mismatch" or "... does not match" would be more readable than "mismatches". The word "matches" can mean either "does match" or "plural of match". It's technically valid to use "mismatches" to mean "does not match", but in practice the word is only ever used to mean "plural of mismatch".
Am 17.05.24 um 11:42 schrieb Andrew Sayers: > On Fri, May 17, 2024 at 10:34:26AM +0200, Sfan5 wrote: >> Signed-off-by: sfan5 <sfan5@live.de> >> --- >> libavformat/tls_mbedtls.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c >> index 1a182e735e..fd6ba0b1f5 100644 >> --- a/libavformat/tls_mbedtls.c >> +++ b/libavformat/tls_mbedtls.c >> @@ -138,6 +138,9 @@ static void handle_handshake_error(URLContext *h, int >> ret) >> case MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE: >> av_log(h, AV_LOG_ERROR, "TLS handshake failed.\n"); >> break; >> + case MBEDTLS_ERR_SSL_BAD_PROTOCOL_VERSION: >> + av_log(h, AV_LOG_ERROR, "TLS protocol version mismatches.\n"); > "... mismatch" or "... does not match" would be more readable than "mismatches". > > The word "matches" can mean either "does match" or "plural of match". > It's technically valid to use "mismatches" to mean "does not match", > but in practice the word is only ever used to mean "plural of mismatch". Alright. Will change for v2.
diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c index 1a182e735e..fd6ba0b1f5 100644 --- a/libavformat/tls_mbedtls.c +++ b/libavformat/tls_mbedtls.c @@ -138,6 +138,9 @@ static void handle_handshake_error(URLContext *h, int ret) case MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE: av_log(h, AV_LOG_ERROR, "TLS handshake failed.\n"); break; + case MBEDTLS_ERR_SSL_BAD_PROTOCOL_VERSION: + av_log(h, AV_LOG_ERROR, "TLS protocol version mismatches.\n"); + break; #endif case MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE:
Signed-off-by: sfan5 <sfan5@live.de> --- libavformat/tls_mbedtls.c | 6 ++++++ 1 file changed, 6 insertions(+) av_log(h, AV_LOG_ERROR, "A fatal alert message was received from the peer, has the peer a correct certificate?\n"); @@ -145,6 +148,9 @@ static void handle_handshake_error(URLContext *h, int ret) case MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED: av_log(h, AV_LOG_ERROR, "No CA chain is set, but required to operate. Was the CA correctly set?\n"); break; + case MBEDTLS_ERR_SSL_INTERNAL_ERROR: + av_log(h, AV_LOG_ERROR, "Internal error encountered.\n"); + break; case MBEDTLS_ERR_NET_CONN_RESET: av_log(h, AV_LOG_ERROR, "TLS handshake was aborted by peer.\n"); break;