Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaas Freitag <freitag@owncloud.com>2014-10-11 17:54:49 +0400
committerKlaas Freitag <freitag@owncloud.com>2014-10-11 17:55:37 +0400
commit2f5cea0e7338ca64547c00080f0cfbc7d25429eb (patch)
treee2668fc8960c6ae91bd17130d58f96243ded241f /src/owncloudcmd
parent282abdd804050c590fac9c6cebfc0dcfa63dfcae (diff)
owncloudcmd: Add a custom ssl verification callback for neon.
That fixes the SSL related problems we had with ci.owncloud.org
Diffstat (limited to 'src/owncloudcmd')
-rw-r--r--src/owncloudcmd/owncloudcmd.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/owncloudcmd/owncloudcmd.cpp b/src/owncloudcmd/owncloudcmd.cpp
index eefbc4229..ebf36bf5d 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;