summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/sslechoserver/sslechoserver.cpp7
-rw-r--r--examples/sslechoserver/sslechoserver.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/examples/sslechoserver/sslechoserver.cpp b/examples/sslechoserver/sslechoserver.cpp
index 53f5066..9b35f15 100644
--- a/examples/sslechoserver/sslechoserver.cpp
+++ b/examples/sslechoserver/sslechoserver.cpp
@@ -78,6 +78,8 @@ SslEchoServer::SslEchoServer(quint16 port, QObject *parent) :
qDebug() << "SSL Echo Server listening on port" << port;
connect(m_pWebSocketServer, &QWebSocketServer::newConnection,
this, &SslEchoServer::onNewConnection);
+ connect(m_pWebSocketServer, &QWebSocketServer::sslErrors,
+ this, &SslEchoServer::onSslErrors);
}
}
//! [constructor]
@@ -138,4 +140,9 @@ void SslEchoServer::socketDisconnected()
pClient->deleteLater();
}
}
+
+void SslEchoServer::onSslErrors(const QList<QSslError> &)
+{
+ qDebug() << "Ssl errors occurred";
+}
//! [socketDisconnected]
diff --git a/examples/sslechoserver/sslechoserver.h b/examples/sslechoserver/sslechoserver.h
index b2ac3f7..84dfeab 100644
--- a/examples/sslechoserver/sslechoserver.h
+++ b/examples/sslechoserver/sslechoserver.h
@@ -44,6 +44,7 @@
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtCore/QByteArray>
+#include <QtNetwork/QSslError>
QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
QT_FORWARD_DECLARE_CLASS(QWebSocket)
@@ -62,6 +63,7 @@ private Q_SLOTS:
void processTextMessage(QString message);
void processBinaryMessage(QByteArray message);
void socketDisconnected();
+ void onSslErrors(const QList<QSslError> &errors);
private:
QWebSocketServer *m_pWebSocketServer;