public void setSecureLevel ( short secureLevel ) throws ClassException { // Security if ( secureLevel == SECURE_CFSSL_BASIC ) { env . put ( "java.naming.security.protocol" , "ssl" ) ; env . put ( "java.naming.ldap.factory.socket" , "javax.net.ssl.SSLSocketFactory" ) ; ClassUtil . loadClass ( "com.sun.net.ssl.internal.ssl.Provider" ) ; Security . addProvider ( new com . sun . net . ssl . internal . ssl . Provider ( ) ) ; } else if ( secureLevel == SECURE_CFSSL_CLIENT_AUTH ) { env . put ( "java.naming.security.protocol" , "ssl" ) ; env . put ( "java.naming.security.authentication" , "EXTERNAL" ) ; } else { env . put ( "java.naming.security.authentication" , "simple" ) ; env . remove ( "java.naming.security.protocol" ) ; env . remove ( "java.naming.ldap.factory.socket" ) ; } }
sets the secure Level