CustomSocketFactorypublic class CustomSocketFactory extends SocketFactory implements ComparatorCustom socket factory for ldaps (SSL).
The comparator only works in JDK 1.6 onwards. Due to a bug in JDK 1.6
compare method invocation fails with a classcast exception. The caller is
trying to pass java.lang.String when it should have passed
javax.net.SocketFactory |
Fields Summary |
---|
private static SocketFactory | socketFactory | public static final String | SSL | protected static final Logger | _logger | protected static final com.sun.enterprise.util.i18n.StringManager | sm |
Methods Summary |
---|
public int | compare(javax.net.SocketFactory s1, javax.net.SocketFactory s2)
return s1.getClass().toString().compareTo(s2.getClass().toString());
| public java.net.Socket | createSocket(java.lang.String arg0, int arg1)
return socketFactory.createSocket(arg0, arg1);
| public java.net.Socket | createSocket(java.net.InetAddress arg0, int arg1)
return socketFactory.createSocket(arg0, arg1);
| public java.net.Socket | createSocket(java.lang.String arg0, int arg1, java.net.InetAddress arg2, int arg3)
return socketFactory.createSocket(arg0, arg1, arg2, arg3);
| public java.net.Socket | createSocket(java.net.InetAddress arg0, int arg1, java.net.InetAddress arg2, int arg3)
return socketFactory.createSocket(arg0, arg1, arg2, arg3);
| public static javax.net.SocketFactory | getDefault()
SSLContext sc = null;
try {
sc = SSLContext.getInstance(SSL);
sc.init(SSLUtils.getKeyManagers(), SSLUtils.getTrustManagers(), new java.security.SecureRandom());
} catch (Exception ex) {
_logger.log(Level.WARNING, "security.exception", ex);
}
socketFactory = sc.getSocketFactory();
return new CustomSocketFactory();
|
|