配置 Tomcat 通过 SSL 使用 Web 服务
应采取哪些步骤通过 SSL 使用远程服务器上的 Web 服务?该应用程序是一个使用 Axis WS Framework 在 Tomcat 6 上运行的 Java 应用程序。
我知道例如 http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html,但是似乎主要描述了如何配置服务器以接受 SSL 请求。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于客户端连接,它就像任何其他 Java 应用程序的 SSL 一样。事实上它在 Tomcat 中运行并没有什么区别。
您需要为 Web 服务指定正确的“https:”端点。如果生成 Web 服务客户端 API 时这不是 WSDL 中的默认值,则可以使用采用 URL 参数的备用构造函数。
如果您正在访问的 Web 服务没有由运行时已识别的“真实”颁发机构颁发的证书,则您需要指定信任存储。最简单的方法是通过 启动应用程序时添加“javax.net.ssl.trustStore”系统属性。
For client connections, it's just like SSL for any other Java application. The fact that it's running in Tomcat doesn't make a difference.
You'll need to specify the correct "https:" endpoint for the web service. If this wasn't the default in the WSDL when you generated the web service client API, you can use an alternate constructor that takes a URL parameter.
If the web service you are accessing doesn't have a certificate issued by a "real" authority that's already recognized by the runtime, you'll need to specify a trust store. The easiest way to do this is by adding the "javax.net.ssl.trustStore" system property when launching the application.
这里有两种常见的方法:
http://ws.apache.org/xmlrpc/ssl.html
WebLogic 有自己的东西:
http://download.oracle.com/docs /cd/E12840_01/wls/docs103/security/SSL_client.html#wp1029670
Two common approaches here:
http://ws.apache.org/xmlrpc/ssl.html
WebLogic has its own stuff:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/security/SSL_client.html#wp1029670