diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/TLSUtils.java b/smack-core/src/main/java/org/jivesoftware/smack/util/TLSUtils.java index fe48ea03a..7b1144952 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/TLSUtils.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/TLSUtils.java @@ -78,7 +78,8 @@ public class TLSUtils { /** * Accept all SSL/TLS certificates. *

- * Warning Use with care. Only use this method if you understand the implications. + * Warning Use with care. This method make the Connection use + * {@link AcceptAllTrustManager}. Only use this method if you understand the implications. *

* * @param conf @@ -134,6 +135,14 @@ public class TLSUtils { } } + /** + * A {@link X509TrustManager} that doesn't validate X.509 certificates. + *

+ * Connections that use this TrustManager will just be encrypted, without any guarantee that the + * counter part is actually the intended one. Man-in-the-Middle attacks will be possible, since + * any certificate presented by the attacker will be considered valid. + *

+ */ public static class AcceptAllTrustManager implements X509TrustManager { @Override @@ -150,7 +159,7 @@ public class TLSUtils { @Override public X509Certificate[] getAcceptedIssuers() { - throw new UnsupportedOperationException(); + return new X509Certificate[0]; } } }