Skip to content

Commit

Permalink
Ensure checking SSL Certificate in IMAP StartTLS.
Browse files Browse the repository at this point in the history
  • Loading branch information
haithngn committed Feb 18, 2021
1 parent b2afd63 commit fad23d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core/imap/MCIMAPSession.cpp
Expand Up @@ -669,18 +669,24 @@ 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:
r = mailimap_ssl_connect_voip(mImap, MCUTF8(mHostname), mPort, isVoIPEnabled());
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;
}
Expand Down

0 comments on commit fad23d7

Please sign in to comment.