aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/xmpp/s2s/Connection.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-07 11:25:23 +0300
committerGravatar Vitaly Takmazov2016-07-07 11:25:23 +0300
commita93c85c5ea1bf6683f604bef2608053957577ff0 (patch)
treef80998a4cf339a2b85cd5f095f4386de9d46597b /src/main/java/com/juick/xmpp/s2s/Connection.java
parent3e48ba7c9cae9027b0a045aa25ae40b533518865 (diff)
parent857a930d31c425185c9b9405f5a7820e6cec9491 (diff)
merge rebase_all
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/Connection.java')
-rw-r--r--src/main/java/com/juick/xmpp/s2s/Connection.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/Connection.java b/src/main/java/com/juick/xmpp/s2s/Connection.java
index c1bbf22e..eae6efaa 100644
--- a/src/main/java/com/juick/xmpp/s2s/Connection.java
+++ b/src/main/java/com/juick/xmpp/s2s/Connection.java
@@ -30,6 +30,7 @@ public class Connection {
public long tsLocalData = 0;
public long bytesLocal = 0;
public long packetsLocal = 0;
+ XMPPComponent xmpp;
Socket socket;
public static final String NS_DB = "jabber:server:dialback";
public static final String NS_TLS = "urn:ietf:params:xml:ns:xmpp-tls";
@@ -52,17 +53,18 @@ public class Connection {
};
- public Connection() throws XmlPullParserException, KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException, UnrecoverableKeyException, KeyManagementException {
+ public Connection(XMPPComponent xmpp) throws XmlPullParserException, KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException, UnrecoverableKeyException, KeyManagementException {
+ this.xmpp = xmpp;
tsCreated = System.currentTimeMillis();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
KeyStore ks = KeyStore.getInstance("JKS");
- try (InputStream ksIs = new FileInputStream(XMPPComponent.keystore)) {
- ks.load(ksIs, XMPPComponent.keystorePassword.toCharArray());
+ try (InputStream ksIs = new FileInputStream(xmpp.keystore)) {
+ ks.load(ksIs, xmpp.keystorePassword.toCharArray());
}
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory
.getDefaultAlgorithm());
- kmf.init(ks, XMPPComponent.keystorePassword.toCharArray());
+ kmf.init(ks, xmpp.keystorePassword.toCharArray());
sc = SSLContext.getInstance("TLSv1.2");
sc.init(kmf.getKeyManagers(), trustAllCerts, new SecureRandom());