credentials: Allow to trust ssl certs in subclasses of HTTPCredentials.

This allows to handle the --trust option in owncloudcmd. In the
owncloudcmd subclass of the httpcredentials, we allow to manually trust
the ssl certificate through a command line switch.
This commit is contained in:
Klaas Freitag 2014-10-11 17:15:07 +02:00
parent ef48de34f7
commit bbcb8ba3e7
2 changed files with 6 additions and 1 deletions

View file

@ -66,7 +66,11 @@ int getauth(const char *prompt,
// qDebug() << "OOO Password requested!";
qstrncpy( buf, pwd.toUtf8().constData(), len );
} else {
re = handleNeonSSLProblems(prompt, buf, len, echo, verify, userdata);
if( http_credentials->sslIsTrusted() ) {
qstrcpy( buf, "yes" ); // Certificate is fine!
} else {
re = handleNeonSSLProblems(prompt, buf, len, echo, verify, userdata);
}
}
return re;
}

View file

@ -52,6 +52,7 @@ public:
virtual QString queryPassword(bool *ok) = 0;
void invalidateToken(Account *account) Q_DECL_OVERRIDE;
QString fetchUser(Account *account);
virtual bool sslIsTrusted() { return false; }
private Q_SLOTS:
void slotAuthentication(QNetworkReply*, QAuthenticator*);