2

I am trying to connect to a webservice over ssl with a client certificate. Is there an elegant way of doing this apart from shoving things like "javax.net.ssl.keyStore" into System.properties.

Any pointers to code examples would be appreciated.

Gilgad
  • 1,137
  • 4
  • 10
  • 10

4 Answers4

0

you might get some samples from the website for this book : http://www.manning.com/kanneganti/

anjanb
  • 12,999
  • 18
  • 77
  • 106
0

Not sure if this is fully relevant, but still. This entry describes the way of generating the certificate and installing it on a local system without using the keytool. Probably you could reuse some parts of the (very simple) source code.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Sergey Mikhanov
  • 8,880
  • 9
  • 44
  • 54
0

You could just install the cert into the system keystore. (Location varies across platforms, and you will need admin rights).

tunaranch
  • 1,584
  • 1
  • 12
  • 17
0

See example code in my article. It shows how to dynamically provide the custom keystore to the HTTPS server as for the WS client. http://jakubneubauer.wordpress.com/2011/09/06/java-webservice-over-ssl/

Jakub
  • 2,344
  • 2
  • 21
  • 20