2012-09-24 90 views
2

我做了下面的步骤,但它引发异常:com.iplanet.services.comm.client.SendRequestException:sun.security.validator.ValidatorException:PKIX路径建设失败:

1.I已经安装openam 10.0。 0 Windows服务器上2003

2.Configured Tomcat的与同一窗口服务器机器上的SSL。

3.It正确配置和openam URL与https访问。另一台机器上

4.Installed openam客户端SDK这是Ubuntu的机器,并从Ubuntu的MACHIN我试图登录使用

 AuthContext lc = new AuthContext("/","https://server.ensarm.com:8443/openam/namingservice"); 
     AuthContext.IndexType indexType = AuthContext.IndexType.MODULE_INSTANCE; 
     lc.login(indexType, "DataStore"); 
     return lc; 

到openam服务器,但我得到以下异常:

ERROR: Naming service connection failed for https://server.ensarm.com:8443/openam/namingservice 
com.iplanet.services.comm.client.SendRequestException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 

我不明白可能是problem.Is是由于我的Java密钥库(需要SSL配置)是Windows服务器的机器上,我有Ubuntu的机器上没有密钥库,

OR

需要导入密钥存储到Ubuntu的机器。??请任何人都可以帮我解决这个问题。

+1

是的,您需要将证书导入到正被Java api使用以连接到URL的KEY存储中。默认情况下它会在JRE/lib/security/cacerts中查找。 –

回答

9

javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径建设失败:” 这意味着服务器不会从授权CA的有效证书

你面临这样的例外,因为你正在尝试通过SSL连接(HTTPS)。您需要将服务器证书导入JRE KeyStore。在浏览器中键入URL(例如https://server.ensarm.com:8443/openam/namingservice):

执行以下步骤来解决它:

获取证书。

  1. 您现在可能会看到一个对话框,提示您有关该证书。现在点击'查看证书'并安装证书。忽略任何警告消息。
  2. 下一步将安装导出证书并将其安装在jre密钥库中。使用keytool证书管理实用程序来执行thishttp://download.oracle.com/javase/1.3/docs/tooldocs/win32/keytool.html。
  3. 导出证书:进入工具 - >'Internet选项' - >内容 - >证书。打开证书后,找到刚刚安装在“受信任的根证书颁发机构”下的证书,选择正确的证书,然后单击“导出”,您现在可以将其保存为(例如mycert.cer的DER编码二进制)
  4. 转到JRE \ BIN并使用-import命令将文件导入到您的cacerts密钥工具密钥库 如密钥工具--import -alias MYCA -keystore .. \ lib \ security中\的cacerts -file C:\ mycert.cer 输入密钥库密码:(默认为“changeit”)输入“yes”作为提示
  5. 运行命令keytool -list -keystore .. \ lib \ security \ cacerts。现在您将看到所有包括您刚添加的证书。
+0

我按照指示说它证书已添加到密钥库。但是当我列出它时,我没有看到它。当我尝试列出时,它询问我的密码是不同的。 – Chookoos

相关问题