[shotwell] SSL: Make it more clear that something failed



commit 932c069ee35dff32d92b0a1ff04273210c77f684
Author: Jens Georg <mail jensge org>
Date:   Fri Aug 12 12:05:43 2016 +0200

    SSL: Make it more clear that something failed
    
    First step of improved SSL communication. Make it more clear that something
    unrecoverably failed with SSL instead of just re-displaying the auth page.
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767473

 plugins/common/RESTSupport.vala                   |    3 +++
 plugins/shotwell-publishing/PiwigoPublishing.vala |    2 ++
 src/plugins/PublishingInterfaces.vala             |    9 ++++++++-
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/plugins/common/RESTSupport.vala b/plugins/common/RESTSupport.vala
index d9bf2ce..838192e 100644
--- a/plugins/common/RESTSupport.vala
+++ b/plugins/common/RESTSupport.vala
@@ -202,6 +202,9 @@ public class Transaction {
             case Soup.KnownStatusCode.CANT_CONNECT_PROXY:
                 throw new Spit.Publishing.PublishingError.NO_ANSWER("Unable to connect to %s (error code 
%u)",
                     get_endpoint_url(), message.status_code);
+            case Soup.KnownStatusCode.SSL_FAILED:
+                throw new Spit.Publishing.PublishingError.SSL_FAILED ("Unable to connect to %s: Secure 
connection failed",
+                    get_endpoint_url ());
             
             default:
                 // status codes below 100 are used by Soup, 100 and above are defined HTTP codes
diff --git a/plugins/shotwell-publishing/PiwigoPublishing.vala 
b/plugins/shotwell-publishing/PiwigoPublishing.vala
index bc83fdc..c3a1bd0 100644
--- a/plugins/shotwell-publishing/PiwigoPublishing.vala
+++ b/plugins/shotwell-publishing/PiwigoPublishing.vala
@@ -912,6 +912,8 @@ public class PiwigoPublisher : Spit.Publishing.Publisher, GLib.Object {
             error_type = "LOCAL_FILE_ERROR";
         } else if(e is Spit.Publishing.PublishingError.EXPIRED_SESSION) {
             error_type = "EXPIRED_SESSION";
+        } else if (e is Spit.Publishing.PublishingError.SSL_FAILED) {
+            error_type = "SECURE_CONNECTION_FAILED";
         }
         
         debug("Unhandled error: type=%s; message='%s'".printf(error_type, e.message));
diff --git a/src/plugins/PublishingInterfaces.vala b/src/plugins/PublishingInterfaces.vala
index 2bbb8d8..7a8ac40 100644
--- a/src/plugins/PublishingInterfaces.vala
+++ b/src/plugins/PublishingInterfaces.vala
@@ -82,7 +82,14 @@ public errordomain PublishingError {
      * Indicates that the remote host has rejected the session identifier used by the local
      * client as out-of-date. The local client should acquire a new session identifier.
      */
-    EXPIRED_SESSION
+    EXPIRED_SESSION,
+
+    /**
+     * Indicates that a secure connection to the remote host cannot be
+     * established. This might have various reasons such as expired
+     * certificats, invalid certificates, self-signed certificates...
+     */
+    SSL_FAILED
 }
 
 /** 


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