• Post Reply Bookmark Topic Watch Topic
  • New Topic

java standalone client calls a webservice over TLS  RSS feed

 
Ravi Danum
Ranch Hand
Posts: 154
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello All,

I am coding a java standalone web service client in Java.

Should the client use SSLContext to set the protocol when connecting to the web service? The web service accepts only TLS.

I have created the web service client code using wsimport, and am asking if SSLContext is needed to be added to this code in order to communicate with the web service over TLS.

Thank you very much.

Ravi

 
Tim Moores
Saloon Keeper
Posts: 3834
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use HttpUrlConnection, then using an HTTPS URL should be sufficient to use SSL/TLS. Nothing would normally be needed.
 
Ravi Danum
Ranch Hand
Posts: 154
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks, Tim.

New question along the same lines.

I have seen the following posted on the internet:



The above code is using java 1.8.

Is the above code necessary in a Java standalone client for TLS communication with a web service?

Many thanks.

-Ravi


 
Paul Clapham
Sheriff
Posts: 22375
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest you try what Tim suggested first because it's simpler. If you have SSL-related problems then you could try that code you posted, but it looks like it's designed to fix a particular problem which may not be your problem -- if you even have a problem.
 
Ravi Danum
Ranch Hand
Posts: 154
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you Paul and Tim!

I appreciate your help and suggestions.

I did read that using TLS from a Java standalone might need the extra code in Java 1.7, but not in Java 1.8.

Thank you both -- I'm feeling more confident, and will try my code soon.

-Ravi
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!