From c1a77181bcec7737497863744b45f0df55cbb91f Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 12 Dec 2013 16:48:30 +0100 Subject: [PATCH] Ignore all errors in initialization of TrustedSocketFactory On Android 2.2 getEnabledProtocols() throws an ArrayIndexOutOfBoundsException --- src/com/fsck/k9/net/ssl/TrustedSocketFactory.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/fsck/k9/net/ssl/TrustedSocketFactory.java b/src/com/fsck/k9/net/ssl/TrustedSocketFactory.java index d24926def..01b4f91a6 100644 --- a/src/com/fsck/k9/net/ssl/TrustedSocketFactory.java +++ b/src/com/fsck/k9/net/ssl/TrustedSocketFactory.java @@ -1,5 +1,9 @@ package com.fsck.k9.net.ssl; +import android.util.Log; + +import com.fsck.k9.K9; + import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; @@ -74,12 +78,9 @@ public class TrustedSocketFactory { SSLSocket sock = (SSLSocket) sf.createSocket(); enabledCiphers = sock.getEnabledCipherSuites(); enabledProtocols = sock.getEnabledProtocols(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } catch (KeyManagementException kme) { - kme.printStackTrace(); - } catch (NoSuchAlgorithmException nsae) { - nsae.printStackTrace(); + } catch (Exception e) { + Log.e(K9.LOG_TAG, "Error getting information about available SSL/TLS ciphers and " + + "protocols", e); } ENABLED_CIPHERS = (enabledCiphers == null) ? null :