使用带有ssl的spring-ldap [英] using spring-ldap with ssl

查看:138
本文介绍了使用带有ssl的spring-ldap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过带有SSL的spring-ldap与LDAP服务器通信,另一端有自签名证书。

I need to talk to an LDAP server via spring-ldap with SSL, and the other end has a self-signed certificate no less.

有什么样的灵魂请指点我做一些设置的说明吗?

Can any kind soul please point me to some instructions for setting this up?

推荐答案

查看春LDAP 通过HTTP(S)连接到LDAP服务器的文档:

Check out Spring LDAP documentation for connecting to LDAP server over HTTP(S):

就自签名证书而言,您可以将证书链导入信任库并设置以下VM参数:

As far as self signed certificate is concerned, you can import certificate chain into a truststore and set the following VM arguments:

-Djavax.net.ssl.trustStore="<path to truststore file>"
-Djavax.net.ssl.trustStorePassword="<passphrase for truststore>"

或在运行时覆盖信任库,如:

or override the truststore at runtime like:

System.setProperty("javax.net.ssl.trustStore","<path to truststore file>");
System.setProperty("javax.net.ssl.trustStorePassword","<passphrase for truststore>");

请记住,这两个选项都将覆盖默认的JVM信任库。因此,如果您使用不同的证书访问不同的站点,您可能希望将所有站点导入一个信任库。

Keep in mind that both options will override default JVM truststore. So if you are hitting different sites with different certs, you may want to import all of them into one truststore.

如果您需要帮助创建信任库文件,请参阅此:数字证书:如何导入。使用?

In case you need help creating truststore file, refer to this: Digital Certificate: How to import .cer file in to .truststore file using?

这篇关于使用带有ssl的spring-ldap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆