Enable SSLv3 if available

This commit is contained in:
M66B 2022-02-22 16:07:35 +01:00
parent 6bf50c8f76
commit 36675a634f
1 changed files with 5 additions and 1 deletions

View File

@ -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<String> 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);