diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index 56e918374..59b44d044 100644 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -685,6 +685,12 @@ void IMAPSession::connect(ErrorCode * pError) * pError = ErrorTLSNotAvailable; goto close; } + if (!checkCertificate()) { + MCLog("StartTLS ssl connect certificate ERROR %d", r); + * pError = ErrorCertificate; + goto close; + } + break; case ConnectionTypeTLS: @@ -701,14 +707,14 @@ void IMAPSession::connect(ErrorCode * pError) setMailStreamSSLContextServerName, const_cast(static_cast(MCUTF8(mHostname)))); #endif - MCLog("ssl connect %s %u %u", MCUTF8(mHostname), mPort, r); + MCLog("TLS ssl connect %s %u %u", MCUTF8(mHostname), mPort, r); if (hasError(r)) { MCLog("connect error %i", r); * pError = ErrorConnection; goto close; } if (!checkCertificate()) { - MCLog("ssl connect certificate ERROR %d", r); + MCLog("TLS ssl connect certificate ERROR %d", r); * pError = ErrorCertificate; goto close; }