Mercurial > trustbridge
annotate ui/sslconnection.cpp @ 1178:59b3c22a404c
(issue142) Only remove certificates if requested
Leave the TrustBridge.ini and the list-installed.txt around otherwise.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 22 Sep 2014 12:38:03 +0200 |
parents | 2a1206932f53 |
children | c64b6c56ce96 |
rev | line source |
---|---|
990
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
3 * |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=2) |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * See LICENSE.txt for details. |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 */ |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 |
1053
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
990
diff
changeset
|
9 /** |
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
990
diff
changeset
|
10 * @file sslconnection.cpp |
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
990
diff
changeset
|
11 * @brief Base implemetation of sslconnection. |
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
990
diff
changeset
|
12 */ |
990
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 #include "sslconnection.h" |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
15 |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 #include <QFile> |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 SSLConnection::SSLConnection(const QString& url, |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 const QByteArray& certificate) : |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 mUrl(url), |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 mPinnedCert(certificate), |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 mInitialized(false), |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 mConnected(false), |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
24 mNeedsReset(false), |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 mServerFD(-1), |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 mErrorState(NoError) |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 { |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 if (certificate.isEmpty()) { |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 #ifdef RELEASE_BUILD |
1162
2a1206932f53
(issue107) Comment all TODO's and FIXME's with issues as documented in issue107
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1088
diff
changeset
|
30 /* TODO (issue95) Change certificate here in case of release build */ |
1088
508c96e72f62
(issue124) Switch server URL and remove some RELEASE_BUILD options
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1053
diff
changeset
|
31 QFile certResource(":certs/ssl-test"); |
990
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 #else |
1088
508c96e72f62
(issue124) Switch server URL and remove some RELEASE_BUILD options
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1053
diff
changeset
|
33 QFile certResource(":certs/ssl-test"); |
990
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 #endif |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 certResource.open(QFile::ReadOnly); |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 mPinnedCert = certResource.readAll(); |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 certResource.close(); |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 } |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 } |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 void SSLConnection::setProxy(const QUrl &proxyUrl) |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 { |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 Q_UNUSED(proxyUrl); |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 qWarning() << "Set proxy not supported"; |
2949f1842955
(issue90) Add possibility to force cipher suites in bare connection and test for this
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 } |