aspose file tools*
The moose likes Java in General and the fly likes How to use LDAP server via Proxy? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to use LDAP server via Proxy?" Watch "How to use LDAP server via Proxy?" New topic
Author

How to use LDAP server via Proxy?

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi All,
I have a LDAP server which needs to be accessed by a proxy. How can I access it via a proxy? If it were Http server then I can use System.setProperty("http.proxyHost","1.1.1.1") sort of settings for host and port but I don't know if my LDAP server requires proxy then how do I do it?
Do we have anything like- ldap.proxyHost or something?
I tried with socksProxyHost, socksProxyPort but I don't know what to give in as socksProxyHost? I know my http/ftp/ssl proxy server's IP address and the socksProxyPort should be 1080 though.
Any help would be great.
Regards
Maulin
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
I guess I'm not understanding the problem... if the proxy server is operating correctly, then it shouldn't matter how you access the LDAP server. The proxy should be transparent to your LDAP client.
Have you tried using JNDI (javax.naming.ldap package) instead of using the lower level socks approach?


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi Phillip
Thanks for your response.
Well, I am using JNDI and the ldap package you mentioned. I will try to re-explain my concern,
1. I have a ldap server X
2. I have a development server Y
3. Y is internal machine to my network which is not allowed to make connection to X directly
4. I have a proxy P that is used to access other servers. e.g. to do telnet, to access html page on those servers via setting browser proxy etc
Now, I know that to do a telnet to some external machine which is not allowing direct telnet to my internal machine, I have to first login to the proxy server (via ssh or telnet) and then do telnet to the external machine. Similarly, if I want to make URLConnection from a code residing on my internal machine to the external server then I use,
System.setProperty("http.proxy","myproxy");
System.setProperty("http.port","myproxyport");
But what if I have to make LDAP connection via JNDI to the external ldap machine which doesn't allow my internal machine to connect to itself directly? I guess, setting above same properties doesn't help me because they are for HTTP proxy , right?
I hope I am able to explain my problem.
Regards
Maulin
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
I understand the issue now. I think that the proxy server must be set up to work with the port/protocol that you want to use. I doubt there is a way around that.
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
Hi Philip
Well, its not really a big issue for me. It was just that I was curious to know if there is a way. Its not hard-and-fast requirement but I have a GUI that can list schema of a given LDAP server and that GUI is on my PC and the LDAP is outside the reach of my PC as I mentioned, so I am little stuck.
Anyways, I also thought that there has to be some support for the protocol via which proxy can work for LDAP connections like http and ftp. May be this could be a start point of some open source development
Regards
Maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use LDAP server via Proxy?