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.
This commit is contained in:
nkinder%redhat.com 2007-03-19 22:59:53 +00:00
Родитель 929416e975
Коммит b4cde0a17f
1 изменённых файлов: 25 добавлений и 18 удалений

Просмотреть файл

@ -42,41 +42,48 @@ public class JSSESocketFactory implements LDAPTLSSocketFactory,
static final long serialVersionUID = 6834205777733266610L;
protected SSLSocketFactory factory = null;
// Optional explicit cipher suites to use
protected String[] suites;
// The socket factory
protected SSLSocketFactory factory;
protected String[] suites = null;
/**
* Default factory constructor
*/
public JSSESocketFactory() {
this(null, null);
this.factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
}
/**
* Factory constructor that uses the default JSSE SSLSocketFactory
* Factory constructor
*
* @param suites Cipher suites to attempt to use with the server;
* if <code>null</code>, use any cipher suites available in the
* JSSE package
*/
public JSSESocketFactory( String[] suites ) {
this(suites, null);
this.suites = suites;
this.factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
}
/**
* Factory constructor that provides an explicit SSLSocketFactory.
*
* @param suites Cipher suites to attempt to use with the server;
* if <code>null</code>, use any cipher suites available in the
* JSSE package
* @param factory the specific SSL server socket factory to use
*/
public JSSESocketFactory( String[] suites, SSLSocketFactory factory ) {
/**
* Factory constructor
* @param sf the SSL socketfactory to use
*/
public JSSESocketFactory( SSLSocketFactory factory) {
this.factory = factory;
}
/**
* Factory constructor
* @param suites Cipher suites to attempt to use with the server;
* if <code>null</code>, use any cipher suites available in the
* JSSE package
* @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;
}
/**
@ -89,7 +96,7 @@ public class JSSESocketFactory implements LDAPTLSSocketFactory,
*/
public Socket makeSocket(String host, int port)
throws LDAPException {
SSLSocket sock = null;
try {