diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2021-02-25 11:53:14 +0100 |
---|---|---|
committer | Carlos Garcia Campos <cgarcia@igalia.com> | 2021-02-25 11:53:14 +0100 |
commit | b45a7f2e0f80af10915be982f28c4888b18fd954 (patch) | |
tree | 57e48b632498e75d36b5c4e738ed58d3cad558a1 | |
parent | 6318579bb82a2ae7ffddcd11c284bc947f47301b (diff) | |
download | libsoup-b45a7f2e0f80af10915be982f28c4888b18fd954.tar.gz |
ssl-test: do not fail if we get connection closed instead of certificate required
It's a glib-networking bug that is making this test flaky
-rw-r--r-- | tests/ssl-test.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/ssl-test.c b/tests/ssl-test.c index 061954f9..a1df8336 100644 --- a/tests/ssl-test.c +++ b/tests/ssl-test.c @@ -170,7 +170,11 @@ do_tls_interaction_test (gconstpointer data) /* Without a GTlsInteraction */ msg = soup_message_new_from_uri ("GET", uri); body = soup_test_session_async_send (session, msg, NULL, &error); - g_assert_error (error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED); + /* Sometimes glib-networking fails to report the error as certificate required + * and we end up with connection reset by peer because the server closes the connection + */ + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED)) + g_assert_error (error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED); g_clear_error (&error); g_bytes_unref (body); g_object_unref (msg); |