[Pkg-owncloud-commits] [owncloud-client] 54/211: credentials: Allow to trust ssl certs in subclasses of HTTPCredentials.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit bbcb8ba3e70d58dcc8d88c991f24a81357b66962
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Sat Oct 11 17:15:07 2014 +0200

    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.
---
 src/creds/httpcredentials.cpp | 6 +++++-
 src/creds/httpcredentials.h   | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/creds/httpcredentials.cpp b/src/creds/httpcredentials.cpp
index 9b91af9..876a9cc 100644
--- a/src/creds/httpcredentials.cpp
+++ b/src/creds/httpcredentials.cpp
@@ -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;
 }
diff --git a/src/creds/httpcredentials.h b/src/creds/httpcredentials.h
index 6fec088..ad14d36 100644
--- a/src/creds/httpcredentials.h
+++ b/src/creds/httpcredentials.h
@@ -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*);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list