Bug#750995: Cannot reject invalid SSL certificate for IMAP server as dialog keeps appearing
forwarded 750995 https://bugs.kde.org/show_bug.cgi?id=335994
tags 750995 + upstream patch
thanks
Bug forwarded to KDE BTS https://bugs.kde.org/show_bug.cgi?id=335994
with patches which provide a workaround
--
Jim Scadden
--- a/kimap/loginjob.cpp
+++ b/kimap/loginjob.cpp
@@ -535,7 +535,7 @@
authState = LoginJobPrivate::Capability;
tags << sessionInternal()->sendCommand( "CAPABILITY" );
} else {
- q->setError( LoginJob::UserDefinedError );
+ q->setError( LoginJob::ERR_SSL_FAILED );
q->setErrorText( i18n( "Login failed, TLS negotiation failed." ) );
encryptionMode = LoginJob::Unencrypted;
q->emitResult();
@@ -588,7 +588,6 @@
setErrorText( i18n( "Connection to server lost." ) );
emitResult();
}
-
}
void LoginJobPrivate::saveServerGreeting(const Message &response)
--- a/kimap/loginjob.h
+++ b/kimap/loginjob.h
@@ -60,7 +60,8 @@
};
enum ErrorCode {
- ERR_COULD_NOT_CONNECT = KJob::UserDefinedError + 23 // same as in kio
+ ERR_COULD_NOT_CONNECT = KJob::UserDefinedError + 23, // same as in kio
+ ERR_SSL_FAILED = KJob::UserDefinedError + 128, // outside of values used by kio
};
explicit LoginJob( Session *session );
--- a/resources/imap/sessionpool.cpp
+++ b/resources/imap/sessionpool.cpp
@@ -378,6 +378,11 @@
i18n( "Could not connect to the IMAP-server.\n%1",
job->errorString() ) );
}
+ } else if ( job->error() == KIMAP::LoginJob::ERR_SSL_FAILED ) {
+ cancelSessionCreation( login->session(),
+ EncryptionError,
+ i18n( "Could not connect to the IMAP-server %1.\n%2",
+ m_account->server(), job->errorString() ) );
} else {
// Connection worked, but login failed -> ask for a different password or ssl settings.
m_pendingInitialSession = login->session();
Reply to: