Java webservice (soap) client - use certificates

2019-02-20 05:43发布

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.

4条回答
太酷不给撩
2楼-- · 2019-02-20 06:25

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

查看更多
放我归山
3楼-- · 2019-02-20 06:30

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.

查看更多
贪生不怕死
4楼-- · 2019-02-20 06:35

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/

查看更多
欢心
5楼-- · 2019-02-20 06:41

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

查看更多
登录 后发表回答