@@ -653,12 +653,14 @@ public boolean isSSL(){
653653 }
654654
655655 /**
656- * Convenience method for setting up a SSL socket factory/engine, using
657- * the DEFAULT_SSL_PROTOCOL and a trusting TrustManager.
658- * Note the trust manager will trust every server certificate presented
656+ * Convenience method for configuring TLS using
657+ * the default set of TLS protocols and a trusting TrustManager.
658+ * This setup is <strong>only suitable for development
659+ * and QA environments</strong>.
660+ * The trust manager will <strong>trust every server certificate presented</strong>
659661 * to it, this is convenient for local development but
660- * not recommended to use in production as it provides no protection
661- * against man-in-the-middle attacks.
662+ * <strong> not recommended to use in production</strong> as it provides no protection
663+ * against man-in-the-middle attacks. Prefer {@link #useSslProtocol(SSLContext)}.
662664 */
663665 public void useSslProtocol ()
664666 throws NoSuchAlgorithmException , KeyManagementException
@@ -667,15 +669,19 @@ public void useSslProtocol()
667669 }
668670
669671 /**
670- * Convenience method for setting up a SSL socket factory/engine, using
671- * the supplied protocol and a very trusting TrustManager.
672- * Note the trust manager will trust every server certificate presented
672+ * Convenience method for configuring TLS using
673+ * the supplied protocol and a very trusting TrustManager. This setup is <strong>only suitable for development
674+ * and QA environments</strong>.
675+ * The trust manager <strong>will trust every server certificate presented</strong>
673676 * to it, this is convenient for local development but
674- * not recommended to use in production as it provides no protection
675- * against man-in-the-middle attacks.
677+ * not recommended to use in production as it <strong>provides no protection
678+ * against man-in-the-middle attacks</strong>.
679+ *
680+ * Use {@link #useSslProtocol(SSLContext)} in production environments.
676681 * The produced {@link SSLContext} instance will be shared by all
677- * the connections created by this connection factory. Use
678- * {@link #setSslContextFactory(SslContextFactory)} for more flexibility.
682+ * the connections created by this connection factory.
683+ *
684+ * Use {@link #setSslContextFactory(SslContextFactory)} for more flexibility.
679685 * @see #setSslContextFactory(SslContextFactory)
680686 */
681687 public void useSslProtocol (String protocol )
@@ -685,13 +691,18 @@ public void useSslProtocol(String protocol)
685691 }
686692
687693 /**
688- * Convenience method for setting up an SSL socket factory/engine.
689- * Pass in the SSL protocol to use, e.g. "TLSv1" or "TLSv1.2".
694+ * Convenience method for configuring TLS.
695+ * Pass in the TLS protocol version to use, e.g. "TLSv1.2" or "TLSv1.1", and
696+ * a desired {@link TrustManager}.
697+ *
698+ *
690699 * The produced {@link SSLContext} instance will be shared with all
691700 * the connections created by this connection factory. Use
692701 * {@link #setSslContextFactory(SslContextFactory)} for more flexibility.
693- * @param protocol SSL protocol to use.
702+ * @param protocol the TLS protocol to use.
703+ * @param trustManager the {@link TrustManager} implementation to use.
694704 * @see #setSslContextFactory(SslContextFactory)
705+ * @see #useSslProtocol(SSLContext)
695706 */
696707 public void useSslProtocol (String protocol , TrustManager trustManager )
697708 throws NoSuchAlgorithmException , KeyManagementException
@@ -702,8 +713,11 @@ public void useSslProtocol(String protocol, TrustManager trustManager)
702713 }
703714
704715 /**
705- * Convenience method for setting up an SSL socket socketFactory/engine.
706- * Pass in an initialized SSLContext.
716+ * Sets up TLS with an initialized {@link SSLContext}. The caller is responsible
717+ * for setting up the context with a {@link TrustManager} with suitable security guarantees,
718+ * e.g. peer verification.
719+ *
720+ *
707721 * The {@link SSLContext} instance will be shared with all
708722 * the connections created by this connection factory. Use
709723 * {@link #setSslContextFactory(SslContextFactory)} for more flexibility.
0 commit comments