Changeset View
Changeset View
Standalone View
Standalone View
src/core/ktcpsocket.cpp
Show All 23 Lines | |||||
24 | #include <ksslcertificatemanager.h> | 24 | #include <ksslcertificatemanager.h> | ||
25 | #include <klocalizedstring.h> | 25 | #include <klocalizedstring.h> | ||
26 | 26 | | |||
27 | #include <QUrl> | 27 | #include <QUrl> | ||
28 | #include <QSslKey> | 28 | #include <QSslKey> | ||
29 | #include <QSslCipher> | 29 | #include <QSslCipher> | ||
30 | #include <QHostAddress> | 30 | #include <QHostAddress> | ||
31 | #include <QNetworkProxy> | 31 | #include <QNetworkProxy> | ||
32 | #include <QNetworkReply> | ||||
32 | #include <QAuthenticator> | 33 | #include <QAuthenticator> | ||
33 | 34 | | |||
34 | static KTcpSocket::SslVersion kSslVersionFromQ(QSsl::SslProtocol protocol) | 35 | static KTcpSocket::SslVersion kSslVersionFromQ(QSsl::SslProtocol protocol) | ||
35 | { | 36 | { | ||
36 | switch (protocol) { | 37 | switch (protocol) { | ||
37 | case QSsl::SslV2: | 38 | case QSsl::SslV2: | ||
38 | return KTcpSocket::SslV2; | 39 | return KTcpSocket::SslV2; | ||
39 | case QSsl::SslV3: | 40 | case QSsl::SslV3: | ||
▲ Show 20 Lines • Show All 1052 Lines • ▼ Show 20 Line(s) | 1081 | { | |||
1092 | if (socket->isEncrypted()) { | 1093 | if (socket->isEncrypted()) { | ||
1093 | d->sslProtocol = socket->sessionCipher().protocolString(); | 1094 | d->sslProtocol = socket->sessionCipher().protocolString(); | ||
1094 | } | 1095 | } | ||
1095 | d->cipher = socket->sessionCipher().name(); | 1096 | d->cipher = socket->sessionCipher().name(); | ||
1096 | d->usedBits = socket->sessionCipher().usedBits(); | 1097 | d->usedBits = socket->sessionCipher().usedBits(); | ||
1097 | d->bits = socket->sessionCipher().supportedBits(); | 1098 | d->bits = socket->sessionCipher().supportedBits(); | ||
1098 | } | 1099 | } | ||
1099 | 1100 | | |||
1101 | KSslErrorUiData::KSslErrorUiData(const QNetworkReply *reply, const QList<QSslError> &sslErrors) | ||||
1102 | : d(new Private()) | ||||
1103 | { | ||||
1104 | const auto sslConfig = reply->sslConfiguration(); | ||||
1105 | d->certificateChain = sslConfig.peerCertificateChain(); | ||||
1106 | | ||||
1107 | d->sslErrors.reserve(sslErrors.size()); | ||||
1108 | for (const QSslError &e : sslErrors) { | ||||
1109 | d->sslErrors.append(KSslError(e)); | ||||
1110 | } | ||||
1111 | | ||||
1112 | d->host = reply->request().url().host(); | ||||
1113 | d->sslProtocol = sslConfig.sessionCipher().protocolString(); | ||||
1114 | d->cipher = sslConfig.sessionCipher().name(); | ||||
1115 | d->usedBits = sslConfig.sessionCipher().usedBits(); | ||||
1116 | d->bits = sslConfig.sessionCipher().supportedBits(); | ||||
1117 | } | ||||
1118 | | ||||
1100 | KSslErrorUiData::KSslErrorUiData(const KSslErrorUiData &other) | 1119 | KSslErrorUiData::KSslErrorUiData(const KSslErrorUiData &other) | ||
1101 | : d(new Private(*other.d)) | 1120 | : d(new Private(*other.d)) | ||
1102 | {} | 1121 | {} | ||
1103 | 1122 | | |||
1104 | KSslErrorUiData::~KSslErrorUiData() | 1123 | KSslErrorUiData::~KSslErrorUiData() | ||
1105 | { | 1124 | { | ||
1106 | delete d; | 1125 | delete d; | ||
1107 | } | 1126 | } | ||
1108 | 1127 | | |||
1109 | KSslErrorUiData &KSslErrorUiData::operator=(const KSslErrorUiData &other) | 1128 | KSslErrorUiData &KSslErrorUiData::operator=(const KSslErrorUiData &other) | ||
1110 | { | 1129 | { | ||
1111 | *d = *other.d; | 1130 | *d = *other.d; | ||
1112 | return *this; | 1131 | return *this; | ||
1113 | } | 1132 | } | ||
1114 | 1133 | | |||
1115 | #include "moc_ktcpsocket.cpp" | 1134 | #include "moc_ktcpsocket.cpp" |