use of com.android.voicemail.impl.mail.CertificateValidationException in project android_packages_apps_Dialer by LineageOS.
the class ImapConnection method open.
public void open() throws IOException, MessagingException {
if (mTransport != null && mTransport.isOpen()) {
return;
}
try {
// copy configuration into a clean transport, if necessary
if (mTransport == null) {
mTransport = mImapStore.cloneTransport();
}
mTransport.open();
createParser();
// The server should greet us with something like
// * OK IMAP4rev1 Server
// consume the response before doing anything else.
ImapResponse response = mParser.readResponse(false);
if (!response.isOk()) {
mImapStore.getImapHelper().handleEvent(OmtpEvents.DATA_INVALID_INITIAL_SERVER_RESPONSE);
throw new MessagingException(MessagingException.AUTHENTICATION_FAILED_OR_SERVER_ERROR, "Invalid server initial response");
}
queryCapability();
maybeDoStartTls();
// LOGIN
doLogin();
} catch (SSLException e) {
LogUtils.d(TAG, "SSLException ", e);
mImapStore.getImapHelper().handleEvent(OmtpEvents.DATA_SSL_EXCEPTION);
throw new CertificateValidationException(e.getMessage(), e);
} catch (IOException ioe) {
LogUtils.d(TAG, "IOException", ioe);
mImapStore.getImapHelper().handleEvent(OmtpEvents.DATA_IOE_ON_OPEN);
throw ioe;
} finally {
destroyResponses();
}
}
Aggregations