diff options
author | 2016-11-08 15:14:28 +0300 | |
---|---|---|
committer | 2016-11-08 15:14:28 +0300 | |
commit | 7e8e8f8d709318cce97f40adaee8a4abbdc2b960 (patch) | |
tree | 73e687f4153daf46bc7662ba4ee284ef5851fed6 /juick-ws/src/main/java/com/juick/ws/s2s/Connection.java | |
parent | 69a2000c03948b3ab8413f210ecf919ab5ef948d (diff) |
xmpp: allow s2s without tls
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/s2s/Connection.java')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/s2s/Connection.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java b/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java index 77c12d1d..b187aa3e 100644 --- a/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java +++ b/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java @@ -61,15 +61,14 @@ public class Connection { KeyStore ks = KeyStore.getInstance("JKS"); try (InputStream ksIs = new FileInputStream(xmpp.keystore)) { ks.load(ksIs, xmpp.keystorePassword.toCharArray()); + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory + .getDefaultAlgorithm()); + kmf.init(ks, xmpp.keystorePassword.toCharArray()); + sc = SSLContext.getInstance("TLSv1.2"); + sc.init(kmf.getKeyManagers(), trustAllCerts, new SecureRandom()); + } catch (Exception e) { + logger.warning("tls unavailable"); } - - KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory - .getDefaultAlgorithm()); - kmf.init(ks, xmpp.keystorePassword.toCharArray()); - sc = SSLContext.getInstance("TLSv1.2"); - - sc.init(kmf.getKeyManagers(), trustAllCerts, new SecureRandom()); - } public void logParser() { |