com.iplanet.services.comm.client.SendRequestException:sun.security.validator.ValidatorException:PKIX路径构建失败:

pbh*_*hle 2 java openssl keystore openam

我做了以下步骤,但它抛出异常:

1.我在Windows Server 2003上安装了openam 10.0.0.

2.在同一台Windows服务器计算机上使用ssl配置tomcat.

3.配置正确,可以使用https访问openam网址.

4.安装openam客户端sdk在另一台机器上,这是ubuntu机器,从那个ubuntu机器我试图登录到openam服务器使用

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

但我得到以下例外:

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
Run Code Online (Sandbox Code Playgroud)

我不明白可能是什么问题.由于我的java密钥库(ssl配置需要)是在Windows服务器机器上,我在ubuntu机器上没有密钥库,

要么

需要将密钥库导入到ubuntu机器中.请任何人帮我摆脱这个.

Vam*_*nti 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证书管理实用程序执行此命令://download.oracle.com/javase/1.3/docs/tooldocs/win32/keytool.html.
  3. 导出证书:转到工具 - >'Internet选项' - >内容 - >证书.打开证书后,找到刚刚安装在"受信任的根证书颁发机构"下的证书.选择正确的证书并单击"导出".现在可以将其保存(DER编码的二进制文件),例如mycert.cer.
  4. 转到JRE\BIN并使用keytool -import命令将文件导入cacerts密钥库.例如keytool --import -alias MYCA -keystore ..\lib\security\cacerts -file c:\ mycert.cer.输入密钥库密码:(默认情况下,它将是"changeit").在提示符处输入"yes".
  5. 运行命令keytool -list -keystore ..\lib\security\cacerts.您现在将看到所有证书的列表,包括您刚添加的证书.