diff options
| author | servonic <servonic@users.noreply.github.com> | 2015-05-22 13:30:50 +0200 |
|---|---|---|
| committer | servonic <servonic@users.noreply.github.com> | 2015-05-22 13:30:50 +0200 |
| commit | 7ffc638a468e958167cc929941f7963a8a4bd9a5 (patch) | |
| tree | 598d2174f70d3a3eb5c2a8d125e7385a88a06bf9 /src/server/QXmppServer.cpp | |
| parent | e59defd97d3f35e772a3382649b057862035ca45 (diff) | |
| download | qxmpp-7ffc638a468e958167cc929941f7963a8a4bd9a5.tar.gz | |
Added possibility to set local TLS certificate and private key as QSslCertificate and QSslKey
Diffstat (limited to 'src/server/QXmppServer.cpp')
| -rw-r--r-- | src/server/QXmppServer.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/server/QXmppServer.cpp b/src/server/QXmppServer.cpp index 643892fd..192a0093 100644 --- a/src/server/QXmppServer.cpp +++ b/src/server/QXmppServer.cpp @@ -482,6 +482,19 @@ void QXmppServer::setLocalCertificate(const QString &path) server->setLocalCertificate(d->localCertificate); } +/// Sets the local SSL certificate +/// +/// \param certificate + +void QXmppServer::setLocalCertificate(const QSslCertificate &certificate) +{ + d->localCertificate = certificate; + + // reconfigure servers + foreach (QXmppSslServer *server, d->serversForClients + d->serversForServers) + server->setLocalCertificate(d->localCertificate); +} + /// Sets the path for the local SSL private key. /// /// \param path @@ -505,6 +518,19 @@ void QXmppServer::setPrivateKey(const QString &path) server->setPrivateKey(d->privateKey); } +/// Sets the local SSL private key. +/// +/// \param key + +void QXmppServer::setPrivateKey(const QSslKey &key) +{ + d->privateKey = key; + + // reconfigure servers + foreach (QXmppSslServer *server, d->serversForClients + d->serversForServers) + server->setPrivateKey(d->privateKey); +} + /// Listen for incoming XMPP client connections. /// /// \param address |
