[libsoup] Don't uselessly g_warn when TLS isn't available
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Don't uselessly g_warn when TLS isn't available
- Date: Fri, 10 Dec 2010 11:58:45 +0000 (UTC)
commit 6cd40fbf575c2211c7382b79042b561ac43dd64f
Author: Dan Winship <danw gnome org>
Date: Fri Dec 10 12:53:48 2010 +0100
Don't uselessly g_warn when TLS isn't available
We g_warn if we can't read the provided SOUP_SESSION_SSL_CA_FILE
(since we have no other way to indicate the error to the app). But
don't warn if the problem is just that the TLS backend isn't available,
since that will cause equally-obvious failures later on that don't
require g_warnings.
libsoup/soup-ssl.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/soup-ssl.c b/libsoup/soup-ssl.c
index 71c4dc1..74d87f2 100644
--- a/libsoup/soup-ssl.c
+++ b/libsoup/soup-ssl.c
@@ -34,8 +34,10 @@ soup_ssl_get_client_credentials (const char *ca_file)
creds->ca_list = g_tls_certificate_list_new_from_file (ca_file, &error);
if (error) {
- g_warning ("Could not set SSL credentials from '%s': %s",
- ca_file, error->message);
+ if (!g_error_matches (error, G_TLS_ERROR, G_TLS_ERROR_UNAVAILABLE)) {
+ g_warning ("Could not set SSL credentials from '%s': %s",
+ ca_file, error->message);
+ }
g_error_free (error);
}
creds->validation_flags = G_TLS_CERTIFICATE_VALIDATE_ALL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]