如何在Java LDAP连接上指定SSL/TLS版本? [英] How to specify SSL/TLS version on Java LDAP connection?
本文介绍了如何在Java LDAP连接上指定SSL/TLS版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Java LDAP客户端,但是我仍然缺少一些有关如何正确执行此操作的信息或知识.
Im working on an java LDAP-Client and I'm still missing some information or knowledge on how to do this properly.
我的代码如下:
LdapContext ctx = null;
Hashtable<String, String> env = new Hashtable <String, String>();
try{
env.clear();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "url");
env.put(Context.SECURITY_PRINCIPAL, "user");
env.put(Context.SECURITY_CREDENTIALS, "password");
env.put(Context.SECURITY_PROTOCOL, "ssl");
env.put("java.naming.security.ssl.ciphers", "SSL_RSA_EXPORT_WITH_RC4_40_MD5");
ctx = new InitialLdapContext(env, null);
} catch(NamingException nex) {
// error handling
}
此刻发生了以下事情:
- 调试ssl连接时,我发现LDAP服务器与程序之间已建立TLSv1连接.
- 我为客户看到以下内容& ssl握手时的服务器:
*** ClientHello, TLSv1.2
和*** ServerHello, TLSv1
我现在缺少的东西:
- 我添加了一个要包括的密码,但是我在客户问候消息中提供的受支持密码列表中没有看到它
- 我未在其问候消息中指定客户端提供TLS1.2,该设置来自何处?
- 我想确定自己是否要使用TLS或SSL,以及将使用哪个版本的TLS或SSL,我该如何实现? (因此,例如,我只能允许TLS 1.1和1.2)
推荐答案
请先扫描服务器,然后再浪费时间查找可能根本无法使用的东西.使用: https://github.com/rbsec/sslscan
Scan you server first before wasting your time for stuff likely not work at all. use: https://github.com/rbsec/sslscan
您的服务器可能仅支持TLS 1.0.
It might be possible that your server support TLS 1.0 only.
这篇关于如何在Java LDAP连接上指定SSL/TLS版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文