comparison ui/sslconnection_curl.cpp @ 942:c8be25c83ff6

Initialize the curl certificate with the default if it is empty.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 26 Aug 2014 11:22:50 +0200
parents a55c6cf54365
children 879a634d0a40
comparison
equal deleted inserted replaced
941:e66e23d340b9 942:c8be25c83ff6
14 SSLConnectionCurl::SSLConnectionCurl(const QString& url, 14 SSLConnectionCurl::SSLConnectionCurl(const QString& url,
15 const QByteArray& certificate): 15 const QByteArray& certificate):
16 SSLConnection (url, certificate), 16 SSLConnection (url, certificate),
17 mCurl (NULL) 17 mCurl (NULL)
18 { 18 {
19 if (certificate.isEmpty()) {
20 QFile certResource(":certs/intevation.de");
21 certResource.open(QFile::ReadOnly);
22 mPinnedCert = certResource.readAll();
23 certResource.close();
24 }
25
19 curl_global_init(CURL_GLOBAL_DEFAULT); 26 curl_global_init(CURL_GLOBAL_DEFAULT);
20 mCurl = curl_easy_init(); 27 mCurl = curl_easy_init();
21 28
22 if (!mCurl) { 29 if (!mCurl) {
23 qDebug() << "Failed to initialize curl"; 30 qDebug() << "Failed to initialize curl";

http://wald.intevation.org/projects/trustbridge/