andre@908: #ifndef UI_SSLCONNECTION_CURL_H andre@908: #define UI_SSLCONNECTION_CURL_H andre@908: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik andre@908: * Software engineering by Intevation GmbH andre@908: * andre@908: * This file is Free Software under the GNU GPL (v>=2) andre@908: * and comes with ABSOLUTELY NO WARRANTY! andre@908: * See LICENSE.txt for details. andre@908: */ andre@908: andre@908: #include "sslconnection.h" andre@908: #include andre@908: andre@908: #include andre@908: andre@908: class SSLConnectionCurl : public SSLConnection andre@908: { andre@908: public: andre@908: SSLConnectionCurl(const QString& url, andre@908: const QByteArray& certificate = QByteArray()); andre@908: andre@908: ~SSLConnectionCurl(); andre@908: andre@908: /** @brief write */ andre@908: int write(const QByteArray& request); andre@908: andre@908: /** andre@908: * @brief read at most len bytes and reset the connection andre@908: * andre@908: * @param [in] len Amount of bytes to read. andre@908: * andre@908: * @returns a byte array containing the data or andre@908: * a NULL byte array on error*/ andre@908: QByteArray read(size_t len); andre@908: andre@908: /** @brief: Establish the connection andre@908: * andre@908: * @returns 0 on success otherwise an error or -1 is returned andre@908: */ andre@908: int connect(); andre@908: private: andre@908: CURL *mCurl; andre@908: QTemporaryFile mCertFile; andre@908: }; andre@908: andre@908: /** andre@908: * @file sslconnection_curl.h andre@908: * @brief SSLConnection utilizing libcurl for http. andre@908: */ andre@908: #endif // UI_SSLCONNECTION_CURL_H