This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Connect To LDAP Via Proxy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Connect To LDAP Via Proxy " Watch "Connect To LDAP Via Proxy " New topic
Author

Connect To LDAP Via Proxy

Murali Klugman
Greenhorn

Joined: Jan 23, 2012
Posts: 1
I currently have the following code to connect to a directory server. I have been told that I need to have the code go through a proxy server (specifically a Squid proxy, if that's relevant). I can't figure out what to change or add in this code to get it to route through the proxy. Any/ all thoughts are welcome.

String url = "ldap://" + IP + ":" + Port;
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_AUTHENTICATION, "none");
env.put(Context.SECURITY_PRINCIPAL, UserID);
env.put(Context.SECURITY_CREDENTIALS, Password);
InitialLdapContext ilc = new InitialLdapContext(env,null);

Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connect To LDAP Via Proxy
 
Similar Threads
eDirectory authentication using SSL
active directory login problems
LDAP query throws error
Connecting to LDAP server over SSL without using certificates
LDAP connection through JNDI WAS 5