获取错误 - javax.net.ssl.SSLHandshakeException:服务器选择了TLSv1,但在调用安全的Web服务时,客户端未启用或不支持该协议版本。
将以下选项附加到oracle站点中建议的mydomain \ bin \ setDomainEnv.cmd中的JAVA_OPTIONS变量,但问题相同。
-Dweblogic.security.SSL.protocolVersion = TLS1
Java client code :
File pKeyFile = new File("C:\\myJKS.jks");
if (pKeyFile.exists() && !pKeyFile.isDirectory()) {
logger.debug("JKS file exists, and it is a file");
}
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(new FileInputStream(pKeyFile.toString()),
pKeyPassword.toCharArray());
KeyManagerFactory keyManagerFactory = KeyManagerFactory
.getInstance("SunX509");
keyManagerFactory.init(keyStore, pKeyPassword.toCharArray());
**SSLContext context = SSLContext.getInstance("TLSv1.1");**
context.init(keyManagerFactory.getKeyManagers(), null,
new SecureRandom());
sockFact = context.getSocketFactory();
if(sockFact == null){
logger.debug("SocketFactory is null");
throw new NullPointerException("socketFactory == null");
}
Client Env - JDK version:7,Application server:Weblogic。
试着让它工作几天,但没有运气。