mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:13:28 +02:00
hand certificate and private key to QSslSocket instances
This commit is contained in:
parent
96de0c1af1
commit
0bc17b0852
3 changed files with 5 additions and 2 deletions
|
@ -42,7 +42,7 @@ HTTPConnection::HTTPConnection (QTcpSocket* socket, HTTPManager* parentManager)
|
|||
HTTPConnection::~HTTPConnection() {
|
||||
// log the destruction
|
||||
if (_socket->error() != QAbstractSocket::UnknownSocketError) {
|
||||
qDebug() << _socket->errorString();
|
||||
qDebug() << _socket->errorString() << "-" << _socket->error();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
HTTPSConnection::HTTPSConnection(QSslSocket* sslSocket, HTTPSManager* parentManager) :
|
||||
HTTPConnection(sslSocket, parentManager)
|
||||
{
|
||||
connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError>&)), this, SLOT(sslErrors(const QList<QSslError>&)));
|
||||
connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError>&)), this, SLOT(handleSSLErrors(const QList<QSslError>&)));
|
||||
sslSocket->startServerEncryption();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,9 @@ HTTPSManager::HTTPSManager(quint16 port, const QSslCertificate& certificate, con
|
|||
void HTTPSManager::incomingConnection(qintptr socketDescriptor) {
|
||||
QSslSocket* sslSocket = new QSslSocket(this);
|
||||
|
||||
sslSocket->setLocalCertificate(_certificate);
|
||||
sslSocket->setPrivateKey(_privateKey);
|
||||
|
||||
if (sslSocket->setSocketDescriptor(socketDescriptor)) {
|
||||
new HTTPSConnection(sslSocket, this);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue