Commit 327d2b1c authored by Volker Krause's avatar Volker Krause
Browse files

Remove the unnecessary explicit SSL protocol selection

This is a leftover from when this was using KTcpSocket, and nowadays was
merely passing around what is the default anyway.
parent e6bd47a0
Pipeline #80584 passed with stage
in 3 minutes and 24 seconds
......@@ -136,7 +136,7 @@ void LoginJob::doStart()
}
if (d->m_encryptionMode == SSLorTLS) {
d->sessionInternal()->startSsl(QSsl::SecureProtocols);
d->sessionInternal()->startSsl();
} else if (d->m_encryptionMode == STARTTLS) {
if (session()->allowsTls()) {
sendCommand(QByteArrayLiteral("STARTTLS"));
......@@ -162,7 +162,7 @@ void LoginJob::handleResponse(const ServerResponse &r)
// Server accepts TLS connection
if (r.isCode(220)) {
d->sessionInternal()->startSsl(QSsl::SecureProtocols);
d->sessionInternal()->startSsl();
return;
}
......
......@@ -302,14 +302,9 @@ void SessionPrivate::socketDisconnected()
m_queue.clear();
}
void SessionPrivate::startSsl(QSsl::SslProtocol version)
void SessionPrivate::startSsl()
{
QMetaObject::invokeMethod(
m_thread,
[this, version] {
m_thread->startSsl(version);
},
Qt::QueuedConnection);
QMetaObject::invokeMethod(m_thread, &SessionThread::startSsl, Qt::QueuedConnection);
}
QSsl::SslProtocol SessionPrivate::negotiatedEncryption() const
......
......@@ -37,7 +37,7 @@ public:
void addJob(Job *job);
void sendData(const QByteArray &data);
void setState(Session::State s);
void startSsl(QSsl::SslProtocol version);
void startSsl();
QSsl::SslProtocol negotiatedEncryption() const;
......
......@@ -188,11 +188,10 @@ ServerResponse SessionThread::parseResponse(const QByteArray &resp)
return ServerResponse(returnCode, response, multiline);
}
void SessionThread::startSsl(QSsl::SslProtocol protocol)
void SessionThread::startSsl()
{
QMutexLocker locker(&m_mutex);
m_socket->setProtocol(protocol);
m_socket->ignoreSslErrors(); // don't worry, we DO handle the errors ourselves below
connect(m_socket.get(), &QSslSocket::encrypted, this, &SessionThread::sslConnected);
m_socket->startClientEncryption();
......
......@@ -39,7 +39,7 @@ public:
public Q_SLOTS:
void reconnect();
void closeSocket();
void startSsl(QSsl::SslProtocol version);
void startSsl();
void sendData(const QByteArray &payload);
Q_SIGNALS:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment