mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-28 11:48:56 +03:00
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:
parent
ef48de34f7
commit
bbcb8ba3e7
2 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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*);
|
||||
|
|
Loading…
Reference in a new issue