1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

lavf/tls_mbedtls: handle more error codes for human-readable messages

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
sfan5
2024-05-13 20:22:44 +02:00
committed by Anton Khirnov
parent b6f37ffba7
commit 63b6620ad3

View File

@@ -138,6 +138,9 @@ static void handle_handshake_error(URLContext *h, int ret)
case MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE: case MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE:
av_log(h, AV_LOG_ERROR, "TLS handshake failed.\n"); av_log(h, AV_LOG_ERROR, "TLS handshake failed.\n");
break; break;
case MBEDTLS_ERR_SSL_BAD_PROTOCOL_VERSION:
av_log(h, AV_LOG_ERROR, "TLS protocol version mismatch.\n");
break;
#endif #endif
case MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE: case MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE:
av_log(h, AV_LOG_ERROR, "A fatal alert message was received from the peer, has the peer a correct certificate?\n"); av_log(h, AV_LOG_ERROR, "A fatal alert message was received from the peer, has the peer a correct certificate?\n");
@@ -145,9 +148,15 @@ static void handle_handshake_error(URLContext *h, int ret)
case MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED: 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"); av_log(h, AV_LOG_ERROR, "No CA chain is set, but required to operate. Was the CA correctly set?\n");
break; break;
case MBEDTLS_ERR_SSL_INTERNAL_ERROR:
av_log(h, AV_LOG_ERROR, "Internal error encountered.\n");
break;
case MBEDTLS_ERR_NET_CONN_RESET: case MBEDTLS_ERR_NET_CONN_RESET:
av_log(h, AV_LOG_ERROR, "TLS handshake was aborted by peer.\n"); av_log(h, AV_LOG_ERROR, "TLS handshake was aborted by peer.\n");
break; break;
case MBEDTLS_ERR_X509_CERT_VERIFY_FAILED:
av_log(h, AV_LOG_ERROR, "Certificate verification failed.\n");
break;
default: default:
av_log(h, AV_LOG_ERROR, "mbedtls_ssl_handshake returned -0x%x\n", -ret); av_log(h, AV_LOG_ERROR, "mbedtls_ssl_handshake returned -0x%x\n", -ret);
break; break;