KIO

ksslerroruidata.cpp
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2007, 2008 Andreas Hartmetz <ahartmetz@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#include "ksslerroruidata.h"
9#include "ksslerroruidata_p.h"
10
11#include <QHostAddress>
12#include <QNetworkReply>
13#include <QSslCipher>
14
16 : d(new Private())
17{
18 d->usedBits = 0;
19 d->bits = 0;
20}
21
22KSslErrorUiData::KSslErrorUiData(const QSslSocket *socket)
23 : d(new Private())
24{
25 d->certificateChain = socket->peerCertificateChain();
26 d->sslErrors = socket->sslHandshakeErrors();
27 d->ip = socket->peerAddress().toString();
28 d->host = socket->peerName();
29 if (socket->isEncrypted()) {
30 d->sslProtocol = socket->sessionCipher().protocolString();
31 }
32 d->cipher = socket->sessionCipher().name();
33 d->usedBits = socket->sessionCipher().usedBits();
34 d->bits = socket->sessionCipher().supportedBits();
35}
36
38 : d(new Private())
39{
40 const auto sslConfig = reply->sslConfiguration();
41 d->certificateChain = sslConfig.peerCertificateChain();
42 d->sslErrors = sslErrors;
43 d->host = reply->request().url().host();
44 d->sslProtocol = sslConfig.sessionCipher().protocolString();
45 d->cipher = sslConfig.sessionCipher().name();
46 d->usedBits = sslConfig.sessionCipher().usedBits();
47 d->bits = sslConfig.sessionCipher().supportedBits();
48}
49
51 : d(new Private(*other.d))
52{
53}
54
56
57KSslErrorUiData &KSslErrorUiData::operator=(const KSslErrorUiData &other)
58{
59 *d = *other.d;
60 return *this;
61}
This class can hold all the necessary data from a QSslSocket or QNetworkReply to ask the user to cont...
KSslErrorUiData()
Default construct an instance with no useful data.
~KSslErrorUiData()
Destructor.
QNetworkRequest request() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.