[evolution-data-server] [ESoupSession] Treat G_TLS_ERROR_BAD_CERTIFICATE as SOUP_STATUS_SSL_FAILED



commit f23376935fbbcd5a3374e23ae2da638fe77b3f8e
Author: Milan Crha <mcrha redhat com>
Date:   Mon Aug 28 18:51:11 2017 +0200

    [ESoupSession] Treat G_TLS_ERROR_BAD_CERTIFICATE as SOUP_STATUS_SSL_FAILED
    
    It seems like since libsoup 2.58.0 the G_TLS_ERROR_BAD_CERTIFICATE
    is propagated to the caller, instead of being transformed to
    SOUP_STATUS_SSL_FAILED error. Due to evolution-data-server code
    all looking for the libsoup error it's easier to just do the transformation
    as it used to be.

 src/libedataserver/e-soup-session.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/libedataserver/e-soup-session.c b/src/libedataserver/e-soup-session.c
index bf049c2..8e71b85 100644
--- a/src/libedataserver/e-soup-session.c
+++ b/src/libedataserver/e-soup-session.c
@@ -948,6 +948,11 @@ e_soup_session_send_request_sync (ESoupSession *session,
        if (input_stream)
                return input_stream;
 
+       if (g_error_matches (local_error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE)) {
+               local_error->domain = SOUP_HTTP_ERROR;
+               local_error->code = SOUP_STATUS_SSL_FAILED;
+       }
+
        if (g_error_matches (local_error, SOUP_HTTP_ERROR, SOUP_STATUS_SSL_FAILED)) {
                message = soup_request_http_get_message (request);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]