ibm websphere

在WEBSPHERE中的使用安全认证和SUN的JDK中的安全认证不同,在WEBSPHERE中需要这样进行设置:
Security.addProvider(new com.ibm.jsse.IBMJSSEProvider());
System.setProperty("java.protocol.handler.pkgs", "com.ibm.net.ssl.www.protocol");
String keyStorePath = config.getProperty("keystorePath");
logger.debug("keyStorePath:=" + keyStorePath);
System.setProperty("javax.net.ssl.keyStore", ResourceUtils.getURL(keyStorePath).getPath());

String trustStorePath = config.getProperty("truststorePath");
System.setProperty(
"javax.net.ssl.trustStore",
ResourceUtils.getURL(trustStorePath).getPath());
System.setProperty(
"javax.net.ssl.trustStorePassword",
config.getProperty("truststorePassword"));
System.setProperty(
"javax.net.ssl.keyStorePassword",
config.getProperty("keystorePassword"));
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");

除这个外,还需要对java.security文件进行修改,具体可参考附件,还需要对local_policy.jar和US_export_policy.jar进行替换,默认的包有字节限制!
对这些进行设置后,对IBM的安全认证就解决了!

你可能感兴趣的:(java,.net,IBM,Security,websphere)