Ensure the error from certificate request is used in test_client_auth_request_fail()
We have this code in test_client_auth_request_fail():
#if OPENSSL_VERSION_NUMBER < 0x10101000L || defined (LIBRESSL_VERSION_NUMBER)
/* FIXME: G_FILE_ERROR_ACCES is not a very great error to get here. */
g_assert_error (test->read_error, G_FILE_ERROR, G_FILE_ERROR_ACCES);
#else
g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED);
#endif
The FIXME is wrong. I misunderstood the purpose of the test when adding the FIXME. The point of the test is to see what happens when the GTlsInteraction certificate request fails. Our mock request uses G_FILE_ERROR_ACCES in this case, so that's the error we should expect.
@icq we spent some time today on IRC trying to debug why we were getting G_TLS_CERTIFICATE_ERROR instead for GnuTLS. You left moments too soon. Turns out, we're not. We're getting G_FILE_ERROR_ACCES. OPENSSL_VERSION_NUMBER is not defined when running the GnuTLS tests, so it's 0, and 0 < 0x10101000L.
This test should check for G_FILE_ERROR_ACCES always.
We also agreed that we should stop and not attempt to connect to the server if a TLS certificate was requested but the TLS interaction fails.