[libsoup] ssl-test: do not fail if we get connection closed instead of certificate required
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] ssl-test: do not fail if we get connection closed instead of certificate required
- Date: Thu, 25 Feb 2021 10:55:57 +0000 (UTC)
commit b45a7f2e0f80af10915be982f28c4888b18fd954
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Thu Feb 25 11:53:14 2021 +0100
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
tests/ssl-test.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]