summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPatrick Griffis <pgriffis@igalia.com>2021-05-26 14:30:55 -0500
committerCarlos Garcia Campos <carlosgc@gnome.org>2021-06-02 07:22:46 +0000
commit4ef4b29a10e04520ffae3a3f38146d3839cf5265 (patch)
treea88442f53d3a670b1e3251d6fef76d39c15c3d49 /tests
parentf88a748e6b02d69f17ba95354807569f9ef19709 (diff)
downloadlibsoup-4ef4b29a10e04520ffae3a3f38146d3839cf5265.tar.gz
ssl-test: Add test case for unhandled PKCS#11 PIN
Diffstat (limited to 'tests')
-rw-r--r--tests/ssl-test.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ssl-test.c b/tests/ssl-test.c
index 345fc026..dde8f807 100644
--- a/tests/ssl-test.c
+++ b/tests/ssl-test.c
@@ -429,6 +429,18 @@ do_tls_interaction_msg_test (gconstpointer data)
g_bytes_unref (body);
g_object_unref (msg);
+ /* It should safely fail when the PIN is unhandled */
+ msg = soup_message_new_from_uri ("GET", uri);
+ soup_message_add_flags (msg, SOUP_MESSAGE_NEW_CONNECTION);
+ g_signal_connect (msg, "request-certificate",
+ G_CALLBACK (request_certificate_cb),
+ pkcs11_certificate);
+ body = soup_test_session_async_send (session, msg, NULL, &error);
+ g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED);
+ g_clear_error (&error);
+ g_bytes_unref (body);
+ g_object_unref (msg);
+
/* Handling the request-certificate-password signal asynchronously */
msg = soup_message_new_from_uri ("GET", uri);
soup_message_add_flags (msg, SOUP_MESSAGE_NEW_CONNECTION);