Don't use STARTTLS if we're already using SSL

Change-Id: I572274abb2d0a52cafd7e0149a74440453ac3e27
This commit is contained in:
Marc Blank 2012-07-31 14:28:16 -07:00
parent 942fea3c97
commit 691d4311a1

View File

@ -1624,8 +1624,8 @@ public class Imap2SyncService extends AbstractSyncService {
if (!mImapResponse.isEmpty()) { if (!mImapResponse.isEmpty()) {
String capa = mImapResponse.get(0).toLowerCase(); String capa = mImapResponse.get(0).toLowerCase();
ArrayList<String> tokens = getTokens(capa); ArrayList<String> tokens = getTokens(capa);
if (tokens.contains("starttls") && tlsSocket == null) { if (tokens.contains("starttls") && tlsSocket == null &&
// Handle STARTTLS ((hostAuth.mFlags & HostAuth.FLAG_SSL) == 0)) {
userLog("[Use STARTTLS]"); userLog("[Use STARTTLS]");
tag = writeCommand(writer, "STARTTLS"); tag = writeCommand(writer, "STARTTLS");
readResponse(reader, tag, "STARTTLS"); readResponse(reader, tag, "STARTTLS");