简体   繁体   English

Java Web服务(肥皂)客户端-使用证书

[英]Java webservice (soap) client - use certificates

I am trying to connect to a webservice over ssl with a client certificate. 我正在尝试使用客户端证书通过ssl连接到Web服务。 Is there an elegant way of doing this apart from shoving things like "javax.net.ssl.keyStore" into System.properties. 除了将“ javax.net.ssl.keyStore”之类的内容推送到System.properties中之外,是否有一种优雅的方法可以做到这一点。

Any pointers to code examples would be appreciated. 任何指向代码示例的指针将不胜感激。

您可能会从网站上获得这本书的一些样本: http : //www.manning.com/kanneganti/

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. 可能您可以重用(非常简单的)源代码的某些部分。

You could just install the cert into the system keystore. 您可以只将证书安装到系统密钥库中。 (Location varies across platforms, and you will need admin rights). (位置因平台而异,您将需要管理员权限)。

See example code in my article. 请参阅我的文章中的示例代码。 It shows how to dynamically provide the custom keystore to the HTTPS server as for the WS client. 它显示了如何像WS客户端一样向HTTPS服务器动态提供定制密钥库。 http://jakubneubauer.wordpress.com/2011/09/06/java-webservice-over-ssl/ http://jakubneubauer.wordpress.com/2011/09/06/java-webservice-over-ssl/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM