From 0a860c793f7e68bde5677391853922249fa6bdea Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 14 Jun 2023 12:21:52 -0700 Subject: [PATCH] adjust test case to handle error of peer closing down --- tests/api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/api.c b/tests/api.c index 1511438da..73b0dd00a 100644 --- a/tests/api.c +++ b/tests/api.c @@ -10476,7 +10476,11 @@ static int test_tls_ext_duplicate(void) wolfSSL_SetIOReadCtx(ssl, &msg); ExpectIntNE(wolfSSL_accept(ssl), WOLFSSL_SUCCESS); - ExpectIntEQ(wolfSSL_get_error(ssl, 0), DUPLICATE_TLS_EXT_E); + /* can return duplicate ext error or socket error if the peer closed down + * while sending alert */ + if (wolfSSL_get_error(ssl, 0) != SOCKET_ERROR_E) { + ExpectIntEQ(wolfSSL_get_error(ssl, 0), DUPLICATE_TLS_EXT_E); + } wolfSSL_free(ssl); wolfSSL_CTX_free(ctx);