File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes Secure way to obtain host address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Secure way to obtain host address" Watch "Secure way to obtain host address" New topic

Secure way to obtain host address

Nuno Miguel Santos

Joined: Nov 01, 2011
Posts: 10
I'm doing a simple RMI project that guarantees a secure communication between a server and client residing on different computers.

So, for communication, I thought of using RMISocketFactory, with an SSLSocket.

My problem resides in obtaining the host address, I don't want it hard-coded in my program.

What secure ways do I have for obtaining an host address?

Encrypt in a text file and read from it?

Regards, Nuno.
Nitesh Kant

Joined: Feb 25, 2007
Posts: 1638

Why do you need to encrypt a hostname?

apigee, a better way to API!
Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

By definition, on the whole internet, host names are public. That is what DNS (dynamic name service or distributed name service) is all about.

If you want to connect to, its public. Period.

I would strongly recommend that you do not use RMI for this project. Use HTTP or if you really need security, use HTTPS
I agree. Here's the link:
subject: Secure way to obtain host address
jQuery in Action, 3rd edition