aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-10-07 10:04:36 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-10-07 10:04:36 +0200
commit26e33de79aad9bd688e1fdfdf0108a962cdc3244 (patch)
tree0b4deaf66515696a7ed95b8baae54b83661c8196 /src/main/java
parent187825d6c680d259633d99c3d9a5da6450a8d37f (diff)
create new instances of key manager every time it's used
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 397d2175..c8f98a34 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -136,7 +136,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();
@@ -149,9 +149,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];
}
}
@@ -174,7 +176,8 @@ public class XmppConnection implements Runnable {
return null;
}
}
- };
+ }
+
private Identity mServerIdentity = Identity.UNKNOWN;
public final OnIqPacketReceived registrationResponseListener = new OnIqPacketReceived() {
@@ -458,7 +461,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;
}