This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Chat app using JSSE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Chat app using JSSE" Watch "Chat app using JSSE" New topic
Author

Chat app using JSSE

Arthur McMillan
Greenhorn

Joined: May 07, 2013
Posts: 2
Hi all,

I want to create a small Android chat app which is able to communicate over SSL with other clients. I want to do this packing the truststore containing the server's certificate in the .apk-file which installs the app.
Now my question is: Is this the right way to do that or is there a better way? I just want to make sure that the app currently only trusts my server.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42367
    
  64
Do you mean that you want to have one device connect directly to another device? That is most likely not going to work (firewalls etc.) - you will very likely end up with the traffic going through a central hub. In which case the problem boils down to an SSL connection to one server (the certificate of which is well-known in advance).


Ping & DNS - my free Android networking tools app
Arthur McMillan
Greenhorn

Joined: May 07, 2013
Posts: 2
Sorry if I didn't explain it understandably:
I actually want my device to connect to one known server as a central hub. The clients' truststores should contain the server's certificate (which is well-known, as you said). All I wanted to know now was if packing this truststore directly in the .apk-file (which installs android apps on a device) is a good solution to make my system possible.
 
jQuery in Action, 2nd edition
 
subject: Chat app using JSSE