没有主机的Applet证书CRL分发点LDAP URL



我正在开发一个web应用程序,该应用程序使用由客户CA颁发的证书签名的小程序。该证书包含指向CRL分发点的URL,该分发点没有定义主机和端口。证书属性"CRL分发点"one_answers"授权信息访问"包含类似于ldap:///CN=my-cn。。。".

由Certificate Revocation-Checking API生成的日志文件(C:\Users[my_user]\AppData\LocalLow\Sun\Java\Deployment\log)表明主机和端口使用值"localhost"one_answers"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

是的,主机是必需的。

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

试着这样创建你的LDAPCertStore

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

祝你好运。

最新更新