From 31d3cdf67362ac96c585690f79f5a042fd33aab0 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 5 Sep 2021 16:52:25 +0200 Subject: [PATCH] Fixed quick setup with invalid certificate --- .../eu/faircode/email/FragmentQuickSetup.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java b/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java index acb6cc9805..8de71e48c6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java @@ -317,6 +317,11 @@ public class FragmentQuickSetup extends FragmentBase { } catch (EmailService.UntrustedException ex) { imap_certificate = ex.getCertificate(); imap_fingerprint = EntityCertificate.getKeyFingerprint(imap_certificate); + iservice.connect( + provider.imap.host, provider.imap.port, + AUTH_TYPE_PASSWORD, null, + user, password, + null, imap_fingerprint); } catch (Throwable ex) { Log.w(ex); // Why not AuthenticationFailedException? @@ -335,6 +340,11 @@ public class FragmentQuickSetup extends FragmentBase { } catch (EmailService.UntrustedException ex1) { imap_certificate = ex1.getCertificate(); imap_fingerprint = EntityCertificate.getKeyFingerprint(imap_certificate); + iservice.connect( + provider.imap.host, provider.imap.port, + AUTH_TYPE_PASSWORD, null, + user, password, + null, imap_fingerprint); } catch (Throwable ex1) { Log.w(ex1); if (!(ex instanceof AuthenticationFailedException) && @@ -379,6 +389,11 @@ public class FragmentQuickSetup extends FragmentBase { } catch (EmailService.UntrustedException ex) { smtp_certificate = ex.getCertificate(); smtp_fingerprint = EntityCertificate.getKeyFingerprint(smtp_certificate); + iservice.connect( + provider.smtp.host, provider.smtp.port, + AUTH_TYPE_PASSWORD, null, + user, password, + null, smtp_fingerprint); } max_size = iservice.getMaxSize();