Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL and Tomcat using Java

I'm new to SSL connections so here goes my question.

I have a desktop Java program in a JAR file. This JAR sends sensitive information over the internet to a remote Tomcat server. Of course I need to encrypt the data.

If I purchase an SSL cerfiticate say from Verisign, will the data sent over SSL be automatically encrypted?

I mean in my JAR, will I still need to do extra work like use Java encryption extensions API to manually encrypt my data over the SSL connection?

Thank you.

like image 426
Marquinio Avatar asked Jun 14 '26 17:06

Marquinio


2 Answers

I mean in my JAR, will I still need to do extra work like use Java encryption extensions API to manually encrypt my data over the SSL connection?

Encryption will be done for you (with the Java Secure Socket Extension). Just establish your connection using https://. Maybe have a look at HTTP Client for a higher level API.

By the way, the certificate goes on the server side (unless you want to do client-authentication too in which case, well, you'll need a client certificate too).

And yes, you could use a self-signed certificate but one of the benefits of using a certificate signed by a well known Certificate Authority (CA) like Verisign, Thawte, etc is that you won't have to add it to the trust store of the client VM (unless you disable the verification mechanism).

like image 181
Pascal Thivent Avatar answered Jun 16 '26 06:06

Pascal Thivent


Follow the SSL Configuration HOW-TO on how to setup https.

like image 29
stacker Avatar answered Jun 16 '26 07:06

stacker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!