1 22 package org.jboss.test.util; 23 24 import java.security.Provider ; 25 26 import org.jboss.logging.Logger; 27 28 35 public class SecurityProviderUtil 36 { 37 private static Logger log = Logger.getLogger(SecurityProviderUtil.class); 38 39 private static String jsseProviderClassName = System.getProperty("jsse.provider.class", 41 "com.sun.net.ssl.internal.ssl.Provider"); 42 43 private static String sslProtocolClass = System.getProperty("www.protocol.class", 44 "com.sun.net.ssl.internal.www.protocol"); 45 46 51 public static Provider getJSSEProvider() 52 { 53 Provider obj = null; 54 ClassLoader tcl = Thread.currentThread().getContextClassLoader(); 55 Class clazz; 56 try 57 { 58 clazz = tcl.loadClass(jsseProviderClassName); 59 obj = (Provider )clazz.newInstance(); 60 } 61 catch (Throwable t) 62 { 63 log.error("getJSSEProvider error:", t); 64 } 65 return obj; 66 } 67 68 73 public static String getProtocolHandlerName() 74 { 75 return sslProtocolClass; 76 } 77 } 78 | Popular Tags |