[Pkg-owncloud-commits] [owncloud-client] 51/211: owncloudcmd: Add a custom ssl verification callback for neon.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 2f5cea0e7338ca64547c00080f0cfbc7d25429eb
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Sat Oct 11 15:54:49 2014 +0200

    owncloudcmd: Add a custom ssl verification callback for neon.
    
    That fixes the SSL related problems we had with ci.owncloud.org
---
 csync/src/csync_owncloud.c      |  2 +-
 src/owncloudcmd/owncloudcmd.cpp | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/csync/src/csync_owncloud.c b/csync/src/csync_owncloud.c
index cc009c9..8207f76 100644
--- a/csync/src/csync_owncloud.c
+++ b/csync/src/csync_owncloud.c
@@ -110,7 +110,7 @@ static int ssl_callback_by_neon(void *userdata, int failures,
         }
     }
     DEBUG_WEBDAV("## VERIFY_SSL CERT: %d", ret  );
-      return ret;
+    return ret;
 }
 
 /*
diff --git a/src/owncloudcmd/owncloudcmd.cpp b/src/owncloudcmd/owncloudcmd.cpp
index eefbc42..ebf36bf 100644
--- a/src/owncloudcmd/owncloudcmd.cpp
+++ b/src/owncloudcmd/owncloudcmd.cpp
@@ -214,6 +214,30 @@ void parseOptions( const QStringList& app_args, CmdOptions *options )
     }
 }
 
+int getauth_cmd(const char *prompt,
+            char *buf,
+            size_t len,
+            int echo,
+            int verify,
+            void *userdata)
+{
+    int re = 0;
+
+    const QString qPrompt = QString::fromLatin1( prompt ).trimmed();
+
+    if( qPrompt.startsWith( QLatin1String("There are problems with the SSL certificate:"))) {
+        // its an SSL problem.
+        if( opts->trustSSL ) {
+            qstrcpy(buf, "yes");
+        } else {
+            qstrcpy(buf, "no");
+        }
+    } else {
+        re = -1;
+    }
+    return re;
+}
+
 int main(int argc, char **argv) {
     QCoreApplication app(argc, argv);
 
@@ -315,6 +339,8 @@ restart_sync:
     opts = &options;
     cred->syncContextPreInit(_csync_ctx);
 
+    csync_set_auth_callback( _csync_ctx, getauth_cmd );
+
     if( csync_init( _csync_ctx ) < 0 ) {
         qFatal("Could not initialize csync!");
         return EXIT_FAILURE;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list