1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-10 05:08:18 -05:00

Ignore all errors in initialization of TrustedSocketFactory

On Android 2.2 getEnabledProtocols() throws an
ArrayIndexOutOfBoundsException
This commit is contained in:
cketti 2013-12-12 16:48:30 +01:00
parent 181ce28413
commit 624a16b900

View File

@ -1,5 +1,9 @@
package com.fsck.k9.net.ssl; package com.fsck.k9.net.ssl;
import android.util.Log;
import com.fsck.k9.K9;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.SSLSocketFactory;
@ -74,12 +78,9 @@ public class TrustedSocketFactory {
SSLSocket sock = (SSLSocket) sf.createSocket(); SSLSocket sock = (SSLSocket) sf.createSocket();
enabledCiphers = sock.getEnabledCipherSuites(); enabledCiphers = sock.getEnabledCipherSuites();
enabledProtocols = sock.getEnabledProtocols(); enabledProtocols = sock.getEnabledProtocols();
} catch (IOException ioe) { } catch (Exception e) {
ioe.printStackTrace(); Log.e(K9.LOG_TAG, "Error getting information about available SSL/TLS ciphers and " +
} catch (KeyManagementException kme) { "protocols", e);
kme.printStackTrace();
} catch (NoSuchAlgorithmException nsae) {
nsae.printStackTrace();
} }
ENABLED_CIPHERS = (enabledCiphers == null) ? null : ENABLED_CIPHERS = (enabledCiphers == null) ? null :