Link to home
Start Free TrialLog in
Avatar of m4trix
m4trixFlag for Canada

asked on

Secure network app (client/server), how do I deal with client truststore?

I have a Client/Server java app that I use on one of my webservers that I, and others, use for uploading files to the server.  It works great, but I would like to add SSL support to it.  My problem is that I want to make it very easy for the clients to use.  Currently the client program is simply a jar archive that they execute, and it spawns a GUI - in fact, I convert the jar to an exe for the windows folk to easily run it.

The problem is that everything I can find on the net regarding client SSL apps requires that they install the server certificate and specify it on the command line for the ap to use it, ie something like:
java -Djavax.net.ssl.trustStore=foobar -Djavx.net.ssl.trustStorePassword=foobar myClient

Is there any way to somehow encapsulate this into the jar file so that the end user need not concern themselves with this?

thanks

Mike
ASKER CERTIFIED SOLUTION
Avatar of sree032397
sree032397

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of m4trix

ASKER

Thanks for the replies guys...  I'm sure all 3 of your solutions might have worked, but I ended up finding my own solution.  All I have to do is include the truststore file in my jar, and add:
     
System.setProperty("javax.net.ssl.trustStore","my_truststore");
System.setProperty("javax.net.ssl.trustStorePassword","my_truststore_password");

to the top of my app, and it works great.

I wish I could split points between you
You can, just follow the Split Points link that you see below (just above the comment box).