Changeset View
Changeset View
Standalone View
Standalone View
src/core/ksslerroruidata.cpp
Show All 30 Lines | 30 | { | |||
---|---|---|---|---|---|
31 | d->usedBits = 0; | 31 | d->usedBits = 0; | ||
32 | d->bits = 0; | 32 | d->bits = 0; | ||
33 | } | 33 | } | ||
34 | 34 | | |||
35 | KSslErrorUiData::KSslErrorUiData(const KTcpSocket *socket) | 35 | KSslErrorUiData::KSslErrorUiData(const KTcpSocket *socket) | ||
36 | : d(new Private()) | 36 | : d(new Private()) | ||
37 | { | 37 | { | ||
38 | d->certificateChain = socket->peerCertificateChain(); | 38 | d->certificateChain = socket->peerCertificateChain(); | ||
39 | d->sslErrors = socket->sslErrors(); | 39 | const auto ksslErrors = socket->sslErrors(); | ||
40 | d->sslErrors.reserve(ksslErrors.size()); | ||||
41 | for (const auto &error : ksslErrors) { | ||||
42 | d->sslErrors.push_back(error.sslError()); | ||||
43 | } | ||||
40 | d->ip = socket->peerAddress().toString(); | 44 | d->ip = socket->peerAddress().toString(); | ||
41 | d->host = socket->peerName(); | 45 | d->host = socket->peerName(); | ||
42 | d->sslProtocol = socket->negotiatedSslVersionName(); | 46 | d->sslProtocol = socket->negotiatedSslVersionName(); | ||
43 | d->cipher = socket->sessionCipher().name(); | 47 | d->cipher = socket->sessionCipher().name(); | ||
44 | d->usedBits = socket->sessionCipher().usedBits(); | 48 | d->usedBits = socket->sessionCipher().usedBits(); | ||
45 | d->bits = socket->sessionCipher().supportedBits(); | 49 | d->bits = socket->sessionCipher().supportedBits(); | ||
46 | } | 50 | } | ||
47 | 51 | | |||
48 | KSslErrorUiData::KSslErrorUiData(const QSslSocket *socket) | 52 | KSslErrorUiData::KSslErrorUiData(const QSslSocket *socket) | ||
49 | : d(new Private()) | 53 | : d(new Private()) | ||
50 | { | 54 | { | ||
51 | d->certificateChain = socket->peerCertificateChain(); | 55 | d->certificateChain = socket->peerCertificateChain(); | ||
52 | 56 | d->sslErrors = socket->sslErrors(); | |||
53 | // See KTcpSocket::sslErrors() | | |||
54 | const auto qsslErrors = socket->sslErrors(); | | |||
55 | d->sslErrors.reserve(qsslErrors.size()); | | |||
56 | for (const QSslError &e : qsslErrors) { | | |||
57 | d->sslErrors.append(KSslError(e)); | | |||
58 | } | | |||
59 | | ||||
60 | d->ip = socket->peerAddress().toString(); | 57 | d->ip = socket->peerAddress().toString(); | ||
61 | d->host = socket->peerName(); | 58 | d->host = socket->peerName(); | ||
62 | if (socket->isEncrypted()) { | 59 | if (socket->isEncrypted()) { | ||
63 | d->sslProtocol = socket->sessionCipher().protocolString(); | 60 | d->sslProtocol = socket->sessionCipher().protocolString(); | ||
64 | } | 61 | } | ||
65 | d->cipher = socket->sessionCipher().name(); | 62 | d->cipher = socket->sessionCipher().name(); | ||
66 | d->usedBits = socket->sessionCipher().usedBits(); | 63 | d->usedBits = socket->sessionCipher().usedBits(); | ||
67 | d->bits = socket->sessionCipher().supportedBits(); | 64 | d->bits = socket->sessionCipher().supportedBits(); | ||
68 | } | 65 | } | ||
69 | 66 | | |||
70 | KSslErrorUiData::KSslErrorUiData(const QNetworkReply *reply, const QList<QSslError> &sslErrors) | 67 | KSslErrorUiData::KSslErrorUiData(const QNetworkReply *reply, const QList<QSslError> &sslErrors) | ||
71 | : d(new Private()) | 68 | : d(new Private()) | ||
72 | { | 69 | { | ||
73 | const auto sslConfig = reply->sslConfiguration(); | 70 | const auto sslConfig = reply->sslConfiguration(); | ||
74 | d->certificateChain = sslConfig.peerCertificateChain(); | 71 | d->certificateChain = sslConfig.peerCertificateChain(); | ||
75 | 72 | d->sslErrors = sslErrors; | |||
76 | d->sslErrors.reserve(sslErrors.size()); | | |||
77 | for (const QSslError &e : sslErrors) { | | |||
78 | d->sslErrors.append(KSslError(e)); | | |||
79 | } | | |||
80 | | ||||
81 | d->host = reply->request().url().host(); | 73 | d->host = reply->request().url().host(); | ||
82 | d->sslProtocol = sslConfig.sessionCipher().protocolString(); | 74 | d->sslProtocol = sslConfig.sessionCipher().protocolString(); | ||
83 | d->cipher = sslConfig.sessionCipher().name(); | 75 | d->cipher = sslConfig.sessionCipher().name(); | ||
84 | d->usedBits = sslConfig.sessionCipher().usedBits(); | 76 | d->usedBits = sslConfig.sessionCipher().usedBits(); | ||
85 | d->bits = sslConfig.sessionCipher().supportedBits(); | 77 | d->bits = sslConfig.sessionCipher().supportedBits(); | ||
86 | } | 78 | } | ||
87 | 79 | | |||
88 | KSslErrorUiData::KSslErrorUiData(const KSslErrorUiData &other) | 80 | KSslErrorUiData::KSslErrorUiData(const KSslErrorUiData &other) | ||
Show All 14 Lines |