diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-10-08 10:40:34 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-10-08 10:40:34 +0200 |
commit | e78a2ae3fe72c28eee9809f5846c0008cb944f39 (patch) | |
tree | 0deabafb77e0daa260faa7cc3e1cf39374116fe9 /src/main | |
parent | 5874be62bc111088df25016318511ab3ca2b0295 (diff) |
create new instances of key manager every time it's used
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 318e91d34..55f258de5 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -140,7 +140,7 @@ public class XmppConnection implements Runnable { private SaslMechanism saslMechanism; - private X509KeyManager mKeyManager = new X509KeyManager() { + private class MyKeyManager implements X509KeyManager { @Override public String chooseClientAlias(String[] strings, Principal[] principals, Socket socket) { return account.getPrivateKeyAlias(); @@ -153,9 +153,11 @@ public class XmppConnection implements Runnable { @Override public X509Certificate[] getCertificateChain(String alias) { + Log.d(Config.LOGTAG,"getting certificate chain"); try { return KeyChain.getCertificateChain(mXmppConnectionService, alias); } catch (Exception e) { + Log.d(Config.LOGTAG,e.getMessage()); return new X509Certificate[0]; } } @@ -178,7 +180,8 @@ public class XmppConnection implements Runnable { return null; } } - }; + } + private Identity mServerIdentity = Identity.UNKNOWN; public final OnIqPacketReceived registrationResponseListener = new OnIqPacketReceived() { @@ -480,7 +483,7 @@ public class XmppConnection implements Runnable { MemorizingTrustManager trustManager = this.mXmppConnectionService.getMemorizingTrustManager(); KeyManager[] keyManager; if (account.getPrivateKeyAlias() != null && account.getPassword().isEmpty()) { - keyManager = new KeyManager[]{mKeyManager}; + keyManager = new KeyManager[]{new MyKeyManager()}; } else { keyManager = null; } |