From d7e2ce7cff84dcf75dfcf312a0f5dbbe76d1ad36 Mon Sep 17 00:00:00 2001 From: "nkinder%redhat.com" Date: Wed, 21 Mar 2007 18:52:57 +0000 Subject: [PATCH] Resolves: 372440 Author: sparkins@redhat.com Summary: Re-implemented bug-fix to add a new constructor for the JSSESocketFactory class that allows an explicit socket factory to be passed in. This bug-fix was reimplemented in order to re-license the LDAP JDK under the standard Mozilla tri-license. git-svn-id: svn://10.0.0.236/trunk@222152 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ietf/ldap/factory/JSSESocketFactory.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/mozilla/directory/java-sdk/ietfldap/org/ietf/ldap/factory/JSSESocketFactory.java b/mozilla/directory/java-sdk/ietfldap/org/ietf/ldap/factory/JSSESocketFactory.java index 9b0f3480a24..09fef7251b5 100644 --- a/mozilla/directory/java-sdk/ietfldap/org/ietf/ldap/factory/JSSESocketFactory.java +++ b/mozilla/directory/java-sdk/ietfldap/org/ietf/ldap/factory/JSSESocketFactory.java @@ -47,10 +47,17 @@ public class JSSESocketFactory static final long serialVersionUID = 6834205777733266609L; + protected SSLSocketFactory factory = null; + // Optional explicit cipher suites to use - private String[] suites; - // The socket factory - private SSLSocketFactory factory; + protected String[] suites = null; + + /** + * Default factory constructor + */ + public JSSESocketFactory() { + this.factory = (SSLSocketFactory) SSLSocketFactory.getDefault(); + } /** * Factory constructor that uses the default JSSE SSLSocketFactory @@ -60,21 +67,29 @@ public class JSSESocketFactory * JSSE package */ public JSSESocketFactory( String[] suites ) { - this(suites, null); + this.suites = suites; + this.factory = (SSLSocketFactory)SSLSocketFactory.getDefault(); + } + + /** + * Factory constructor + * @param sf the SSL socketfactory to use + */ + public JSSESocketFactory( SSLSocketFactory factory) { + this.factory = factory; } /** - * Factory constructor that provides an explicit SSLSocketFactory. + * Factory constructor * * @param suites Cipher suites to attempt to use with the server; * if null, use any cipher suites available in the * JSSE package - * @param factory the specific SSL server socket factory to use + * @param sf the SSL socketfactory to use */ public JSSESocketFactory( String[] suites, SSLSocketFactory factory ) { this.suites = suites; - this.factory = (factory != null) ? factory : - (SSLSocketFactory)SSLSocketFactory.getDefault(); + this.factory = factory; } /**