2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef SSLCLIENT_H
|
|
|
|
#define SSLCLIENT_H
|
|
|
|
|
2017-09-21 11:24:07 +00:00
|
|
|
#include <QtNetwork>
|
|
|
|
|
|
|
|
QT_REQUIRE_CONFIG(ssl);
|
|
|
|
|
|
|
|
#include <QtWidgets>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class Ui_Form;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
class SslClient : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-09-21 11:24:07 +00:00
|
|
|
explicit SslClient(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
~SslClient();
|
2013-03-14 23:42:15 +00:00
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
private slots:
|
|
|
|
void updateEnabledState();
|
|
|
|
void secureConnect();
|
|
|
|
void socketStateChanged(QAbstractSocket::SocketState state);
|
|
|
|
void socketEncrypted();
|
|
|
|
void socketReadyRead();
|
|
|
|
void sendData();
|
2014-10-21 13:24:37 +00:00
|
|
|
void socketError(QAbstractSocket::SocketError error);
|
2011-04-27 10:05:43 +00:00
|
|
|
void sslErrors(const QList<QSslError> &errors);
|
|
|
|
void displayCertificateInfo();
|
|
|
|
|
|
|
|
private:
|
2017-09-21 11:24:07 +00:00
|
|
|
void setupUi();
|
|
|
|
void setupSecureSocket();
|
2011-04-27 10:05:43 +00:00
|
|
|
void appendString(const QString &line);
|
|
|
|
|
2017-09-21 11:24:07 +00:00
|
|
|
QSslSocket *socket = nullptr;
|
|
|
|
QToolButton *padLock = nullptr;
|
|
|
|
Ui_Form *form = nullptr;
|
|
|
|
bool handlingSocketError = false;
|
|
|
|
bool executingDialog = false;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|