Finding JNDI/LDAP Connection Security Protocol

' - Debugging SSL Socket Communication' tutorial was cited in a stackoverflow forum post in 2016.

The - 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
>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("", 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 (
/jndi/jndi-ldap-gl.html), the only value for 
is "ssl".

With Context.SECURITY_PROTOCOL="ssl" :
•it opens a secure SSL/TLS connexion if the serveur supports it
•it fails with a 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 and can see which version of TLS and cipher is 
used by your connection. (see

Table of Contents

 About This Book

 Reference Citations in 2017

Reference Citations in 2016


 cliente soap java

 Android Hints Tweaks and Tips

 [Tutorial] - Play HD Videos with ffplay

 Comment ouvrir les fichiers XML

 Počítačová síť a internet

 Deploying Embarcadero Delphi XE7 and C++Builder XE7 Applications

 Change XSD root namespace in BizTalk

 Заставить пример java + ssl работать


 General Relativity for Laypeople – A First Primer

 XML Dynamic Key Encryption Approach

 Подключение к MS SQL Server из NetBeans

 TCP SSL 서버 성능테스트 관련 질문

 Tạo cửa sổ con nằm trong cửa sổ tab chính trong Java

 FAQ DMP Compatibilité

 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

 how to import x509.pem pk8 file into jks(keystore)

 Reference Citations in 2015

 Reference Citations in 2014

 Reference Citations in 2013

 Reference Citations in 2012

 Reference Citations in 2011

 Reference Citations in 2010

 Reference Citations in 2009

 Reference Citations in 2008

 Reference Citations in 2007

 Reference Citations in 2006

 Reference Citations in 2005

 Reference Citations in 2004

 Reference Citations in 2003

 PDF Printing Version