owncloudcmd: Add a custom ssl verification callback for neon.

That fixes the SSL related problems we had with ci.owncloud.org
This commit is contained in:
Klaas Freitag 2014-10-11 15:54:49 +02:00
parent 282abdd804
commit 2f5cea0e73
2 changed files with 27 additions and 1 deletions

View file

@ -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;
}
/*

View file

@ -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;