From 36675a634f4ba6fac69b33dc03e01d104197e789 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 22 Feb 2022 16:07:35 +0100 Subject: [PATCH] Enable SSLv3 if available --- app/src/main/java/eu/faircode/email/EmailService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index b63e19823d..a177e1cd04 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -1167,10 +1167,14 @@ public class EmailService implements AutoCloseable { } sslSocket.setEnabledCipherSuites(ciphers.toArray(new String[0])); } else { + // Enable SSLv3 if available + sslSocket.setEnabledProtocols(sslSocket.getSupportedProtocols()); + List ciphers = new ArrayList<>(); ciphers.addAll(Arrays.asList(sslSocket.getEnabledCipherSuites())); for (String cipher : sslSocket.getSupportedCipherSuites()) - if (cipher.contains("3DES")) { + if (!ciphers.contains(cipher) && + (cipher.contains("3DES") || cipher.contains("RC4"))) { // Some servers support 3DES and RC4 only Log.i("SSL enabling cipher=" + cipher); ciphers.add(cipher);