[glib-networking] gnutls: Appropriate error when server requires cert but none
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking] gnutls: Appropriate error when server requires cert but none
- Date: Thu, 29 Nov 2012 22:04:52 +0000 (UTC)
commit 81a9ae337ed60fc4ef9abbf6f306d55554c5d7f8
Author: Stef Walter <stefw gnome org>
Date: Thu Nov 29 11:00:00 2012 +0100
gnutls: Appropriate error when server requires cert but none
When the server requires a certificate for auth, but none is
provider, return the appropriate G_TLS_ERROR_CERTIFICATE_REQUIRED
error.
https://bugzilla.gnome.org/show_bug.cgi?id=689260
tls/gnutls/gtlsconnection-gnutls.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index f3602f2..2603532 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -750,6 +750,12 @@ end_gnutls_io (GTlsConnectionGnutls *gnutls,
else
return 0;
}
+ else if (status == GNUTLS_E_NO_CERTIFICATE_FOUND)
+ {
+ g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED,
+ _("TLS connection peer did not send a certificate"));
+ return status;
+ }
if (error)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]