Reference Citations - HerongYang.com - v2.95, by Herong Yang
Finding JNDI/LDAP Connection Security Protocol
'javax.net.debug - Debugging SSL Socket Communication' tutorial was cited in a stackoverflow forum post in 2016.
The javax.net.debug - Debugging SSL Socket Communication tutorial was cited in a stackoverflow forum post in 2016.
Subject: Finding JNDI/LDAP Connection Security Protocol Date: Dec 19, 2016 Author: Olivier T Source: http://stackoverflow.com/questions/41167721 /finding-jndi-ldap-connection-security-protocol >I'm using java (8) to connect to an LDAP-Server to get some >information. I'm doing this over SSL but I cannot figure out if my >specified security protocol is actually being used.... > >Here is my code: > 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.SECURITY_PRINCIPAL, "user"); > env.put(Context.SECURITY_CREDENTIALS, "password"); > env.put(Context.SECURITY_PROTOCOL, "ssl"); > env.put("com.sun.jndi.ldap.read.timeout", 5000); > env.put("com.sun.jndi.ldap.connect.timeout", 5000); > env.put(Context.PROVIDER_URL, "myurl"); > ctx = new InitialLdapContext(env, null); > } catch(NamingException nex) { > ... ... According to your link ( http://docs.oracle.com/javase/8/docs/technotes/guides/jndi /jndi-ldap-gl.html), the only value for java.naming.security.protocol is "ssl". With Context.SECURITY_PROTOCOL="ssl" : •it opens a secure SSL/TLS connexion if the serveur supports it •it fails with a javax.net.ssl.SSLHandshakeException otherwise With Context.SECURITY_PROTOCOL=any other word than "ssl", it opens a simple connection (with no SSL/TLS) So, with the standard factory (com.sun.jndi.ldap.LdapCtxFactory) and with "ssl" param, you use a SSL/TLS connexion or do nothing. You can see a lot of details of your connection with the parameter -Djava.net.debug=ssl and can see which version of TLS and cipher is used by your connection. (see https://www.herongyang.com/JDK /SSL-Socket-Communication-Debug-javax-net-debug.html)
Table of Contents
Java Server Accepts TLS 1.2 Only
[Tutorial] - Play HD Videos with ffplay
Comment ouvrir les fichiers XML
Deploying Embarcadero Delphi XE7 and C++ Builder XE7 Applications
Change XSD root namespace in BizTalk
Заставить пример java + ssl работать
字符编码的故事:ASCII,GB2312,Unicode,UTF-8,UTF-16
General Relativity for Laypeople – A First Primer
XML Dynamic Key Encryption Approach
Подключение к MS SQL Server из NetBeans
Tạo cửa sổ con nằm trong cửa sổ tab chính trong Java
How does PHP determine the character encoding in browser POST request data?
Implementing the Information Security using Modified RSA
Recording Video of an Android Device
Getting error for SOAP request "InvalidSecurity: ..."
►Finding JNDI/LDAP Connection Security Protocol