mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
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:
parent
282abdd804
commit
2f5cea0e73
2 changed files with 27 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue