【发布时间】:2011-08-20 14:09:30
【问题描述】:
设置:WL 的 Jrockit 上的 WL 9.2 + Jersey 1.1.5.1。 我相信,之所以选择 Jersey 1.1.5.1,是因为较新的版本需要 Java 6。 Weblogic EJB 充当 REST 客户端并不断收到此错误:
ClientHandlerException: javax.net.ssl.SSLKeyException: [Security:090477] 从 svcpoint.restprovider.com 收到的证书链 - xx.xxx.xxx.xx 不受信任,导致 SSL 握手失败。
由于这只是一个 POC 实现,Weblogic 设置了各种标志来忽略证书验证,只是为了让这个错误消失:
-Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.SSL.enforceConstraints=off -Dweblogic.webservice.client.ssl.strictcertchecking=false
此外,Jersey 配置设置包括以下内容:
SSLContext ctx = SSLContext.getInstance("SSL");
HTTPSProperties prop = new HTTPSProperties(
new HostnameVerifier () {
public boolean verify(String hostname, SSLSession session) {
System.out.println("\n\nFAKE_Verifier: " + hostname+"\n\n");
return true;
}
}, ctx);
config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, prop);
最后,唯一的 WL 服务器,技术上是 admin srv,在管理控制台 SSL.Advanced 设置中配置为不使用主机名验证。
现在,我很确定我的 Jersey 假验证器设置实际上并没有涉及,因为我从 SSL 调试中看到了这个错误:
<SecuritySSL> <000000> <weblogic user specified trustmanager validation status 16>
<Security> <BEA-090477> <Certificate chain received from svcpoint.restprovider.com - xx.xxx.xxx.xx was not trusted causing SSL handshake failure.>
<SecuritySSL> <000000> <Validation error = 16>
<SecuritySSL> <000000> <Certificate chain is untrusted>
<SecuritySSL> <000000> <SSLTrustValidator returns: 16>
<SecuritySSL> <000000> <Trust status (16): CERT_CHAIN_UNTRUSTED>
<SecuritySSL> <000000> <NEW ALERT with Severity: FATAL, Type: 42
java.lang.Exception: New alert stack
at com.certicom.tls.record.alert.Alert.<init>(Unknown Source)
我在 SO 上搜索并查看了其他类似的问题,但我可能遗漏了一些东西。此外,据我判断,该证书似乎有效,表明它适用于 CN=*.restprovider.com,将于 2011 年 11 月到期。
【问题讨论】:
标签: rest ssl https weblogic jersey