summaryrefslogtreecommitdiff
path: root/src/websockets/qwebsocket_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/websockets/qwebsocket_p.h')
-rw-r--r--src/websockets/qwebsocket_p.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/websockets/qwebsocket_p.h b/src/websockets/qwebsocket_p.h
index ad667aa..c193a70 100644
--- a/src/websockets/qwebsocket_p.h
+++ b/src/websockets/qwebsocket_p.h
@@ -90,7 +90,24 @@ public:
public:
#ifndef QT_NO_SSL
- QSslConfiguration m_sslConfiguration;
+ struct TlsConfigurationLazy {
+ TlsConfigurationLazy &operator = (const QSslConfiguration &rhs)
+ {
+ tlsConfiguration.reset(new QSslConfiguration(rhs));
+ return *this;
+ }
+
+ operator QSslConfiguration() const
+ {
+ if (!tlsConfiguration.get())
+ tlsConfiguration.reset(new QSslConfiguration(QSslConfiguration::defaultConfiguration()));
+ return *tlsConfiguration.get();
+ }
+
+ mutable std::unique_ptr<QSslConfiguration> tlsConfiguration;
+ };
+
+ TlsConfigurationLazy m_sslConfiguration;
QList<QSslError> m_ignoredSslErrors;
bool m_ignoreSslErrors;
#endif