0

我正在开发一个使用由客户 CA 颁发的证书签名的小程序的 Web 应用程序。该证书包含指向未定义主机和端口的 CRL 分发点的 URL。证书属性“CRL Distribution Points”和“Authority Information Access”包含类似于“ldap:///CN=my-cn...”的 URL。

证书撤销检查 API (C:\Users[my_user]\AppData\LocalLow\Sun\Java\Deployment\log) 生成的日志文件表明值“localhost”和“389”正用于主机和端口. 这是日志文件的片段:

...
certpath: DistributionPointFetcher.getCRLs: Checking CRLDPs for CN=xxx, O=yyy, L=zzz, C=PT
certpath: Trying to fetch CRL from DP ldap:///CN=_my-cn_?certificateRevocationList?base?objectClass=cRLDistributionPoint
certpath: CertStore URI:ldap:///CN=_my-cn_?certificateRevocationList?base?objectClass=cRLDistributionPoint
...
network: Connecting http://localhost:389/ with proxy=DIRECT
...
certpath: LDAPCertStore.engineInit about to throw InvalidAlgorithmParameterException
javax.naming.CommunicationException: localhost:389 [Root exception is    java.net.ConnectException: Connection refused: connect]
  at com.sun.jndi.ldap.Connection.<init>(Unknown Source)
...

谁能确认主机是强制性的,否则使用默认值“localhost”?

我在 LDAP RFC ( http://www.ietf.org/rfc/rfc4516.txt ) 中读到,如果“主机”字段不存在,则客户端必须先验了解要联系的适当 LDAP 服务器。是否可以配置“主机”属性?

我正在使用 JRE 版本 1.7.0_45(内部版本 1.7.0_45-b18)。

谢谢, Telmo Simões

4

1 回答 1

0

是的,主持人是强制性的。

这在一定程度上取决于您的代码如何(如果)创建LDAPCertStore对象。当你调用构造函数时,你需要传递一个LDAPCertStoreParameters对象给它。该类包含一个允许您指定主机(和端口)的构造器。

尝试创建LDAPCertStore这样的:

LDAPCertStoreParameters params = new LDAPCertStoreParameters( "hostname", 389 );
CertStore   store = CertStore.getInstance("LDAP", params);

祝你好运。

于 2014-03-03T10:05:57.617 回答