0

I have created a web service client.I have been provided with a certificate "Certificate.Security.pfx" file, which I have placed on my local system.

I am looking for a java code example which shows how to access a secure web service over SSL using a PFX certificate.

I don't have any other details and this is my first time working with a certificate based web service. Browsing through the internet, somewhere I found I need to change it to "JKS". Is that true?

Thanks, Paul

kingAm
  • 1,755
  • 1
  • 13
  • 23
Manoj
  • 11
  • 2
  • You can change it to JKS but that can also be bypassed. You need a keystore. Take a look at this answer http://stackoverflow.com/a/30953348/4807777 for a reference to other SO useful resources and tools to get you started. – Laurentiu L. Jun 24 '15 at 07:58
  • Thanks Laurentiu, do I need to have/covert to .cer file? – Manoj Jun 24 '15 at 08:54
  • Not necessarily. The cer file is what you usually receive when you connect to a webservice, from there you split it. You can just use the format you received, and inspect it with the tools recommended there. There are options vor every format to import into a keystore,use a different format for the keystore. – Laurentiu L. Jun 24 '15 at 09:01
  • All looks good now with the certificate and keystore, but I am not able to connect to the host through Java code. I am getting a "java.net.UnknownHostException:" exception. Although I can access the host and wsdl link via browser. – Manoj Jun 25 '15 at 14:08
  • To add to the previous comment. I have also disabled my system firewall. And my browser has a setting that use a Proxy Server. I can also access the host by using ping -t command on the command prompt. – Manoj Jun 25 '15 at 14:32

0 Answers0