Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlsslconfiguration_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQMLSSLCONFIGURATION_P_H
5#define QQMLSSLCONFIGURATION_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qtqmlnetworkexports.h>
19#include "qqmlsslkey_p.h"
20
21#include <QtCore/QByteArray>
22#include <QtCore/QMetaType>
23#include <QtQml/qqml.h>
24#include <QtNetwork/qsslconfiguration.h>
25#include <QtNetwork/qsslsocket.h>
26#include <QtNetwork/qssl.h>
27
29
30class Q_QMLNETWORK_EXPORT QQmlSslConfiguration
31{
33
34 Q_PROPERTY(QString ciphers READ ciphers WRITE setCiphers)
35 Q_PROPERTY(QList<QSsl::SslOption> sslOptions READ sslOptions WRITE setSslOptions)
36 Q_PROPERTY(QSsl::SslProtocol protocol READ protocol WRITE setProtocol)
37 Q_PROPERTY(QSslSocket::PeerVerifyMode peerVerifyMode READ peerVerifyMode
38 WRITE setPeerVerifyMode)
39 Q_PROPERTY(int peerVerifyDepth READ peerVerifyDepth WRITE setPeerVerifyDepth)
40 Q_PROPERTY(QByteArray sessionTicket READ sessionTicket WRITE setSessionTicket)
41
42public:
43 Q_INVOKABLE void setCertificateFiles(const QStringList &certificateFiles);
44 Q_INVOKABLE void setPrivateKey(const QQmlSslKey &privateKey);
45
46 QString ciphers() const;
47 QList<QSsl::SslOption> sslOptions() const;
48 QSsl::SslProtocol protocol() const;
49 QSslSocket::PeerVerifyMode peerVerifyMode() const;
50 int peerVerifyDepth() const;
51 QByteArray sessionTicket() const;
52 QSslConfiguration const configuration();
53
54 void setProtocol(QSsl::SslProtocol protocol);
55 void setPeerVerifyMode(QSslSocket::PeerVerifyMode mode);
56 void setPeerVerifyDepth(int depth);
57 void setCiphers(const QString &ciphers);
58 void setSslOptions(const QList<QSsl::SslOption> &options);
59 void setSessionTicket(const QByteArray &sessionTicket);
60
62 inline friend bool operator==(const QQmlSslConfiguration &lval,
63 const QQmlSslConfiguration &rval)
64 {
65 return lval.m_certificateFiles == rval.m_certificateFiles
66 && lval.m_ciphers == rval.m_ciphers
67 && lval.m_sslOptions == rval.m_sslOptions
68 && lval.m_configuration == rval.m_configuration;
69 }
70
71 inline friend bool operator!=(const QQmlSslConfiguration &lval,
72 const QQmlSslConfiguration &rval)
73 {
74 return !(lval == rval);
75 }
76
77protected:
78 void setSslOptionsList(const QSslConfiguration &configuration);
79 void setCiphersList(const QSslConfiguration &configuration);
80
83 QList<QSsl::SslOption> m_sslOptions;
85};
86
87class Q_QMLNETWORK_EXPORT QQmlSslDefaultConfiguration : public QQmlSslConfiguration
88{
90 QML_NAMED_ELEMENT(sslConfiguration)
92
93public:
95};
96
97class Q_QMLNETWORK_EXPORT QQmlSslDefaultDtlsConfiguration : public QQmlSslConfiguration
98{
100 QML_NAMED_ELEMENT(sslDtlsConfiguration)
102
103public:
105};
106
108
109#endif // QQMLSSLCONFIGURATION_P_H
\inmodule QtCore
Definition qbytearray.h:57
Definition qlist.h:75
friend bool operator!=(const QQmlSslConfiguration &lval, const QQmlSslConfiguration &rval)
QList< QSsl::SslOption > m_sslOptions
QSslConfiguration m_configuration
The QSslConfiguration class holds the configuration and state of an SSL connection.
The QSslSocket class provides an SSL encrypted socket for both clients and servers.
Definition qsslsocket.h:29
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QSsl namespace declares enums common to all SSL classes in Qt Network.
Combined button and popup list for selecting options.
GLint GLenum GLsizei GLsizei GLsizei depth
GLenum mode
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_INVOKABLE
#define Q_GADGET
config setProtocol(QSsl::TlsV1_2)