Web 服务代理中的 SSL 证书问题
我正在构建一个 JAVA Web 服务客户端,在其中连接到服务。
该服务具有 ssl 证书验证。
如何使用 ssl 证书验证来调用此服务。
我在使用 Eclipse 构建的客户端中使用 JAX-RPC 实现。
举一个例子。
I am building a JAVA web service client in which i connect to a service.
This service has a ssl certificate verification.
How to call this service using ssl certificate verification.
I am using JAX-RPC implementation in client built using Eclipse.
An example would be appriciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我能够进行 Web 服务连接...
我使用以下命令添加了密钥存储:
将密码指定为“changeit”,并在密钥存储中添加了证书。
现在在代码中我添加了两行:
还添加了
其中 _call 是调用类的调用对象。
并且成功了!!!!!!
I am able to do the web service connection...
I added the key store using the command:
gave the password as "changeit" and added the certificate in keystore.
Now in code i added two lines:
also added
where _call is the call object of Call Class.
And it worked!!!!!!
您需要做的就是使用以下命令行将服务器根证书注入到 JDK/JRE 环境中: -
默认 [your_keystore] 是
默认密码是 changeit。
当您调用网络服务时,只需提及“
我希望这可以帮助您实现您的要求”。
问候,
查理 Ch.
All you need to do is injecting the server root certificate to your JDK/JRE environments by using the following command line: -
The default [your_keystore] is
The default password is changeit.
When you call the web service, just mention the
I hope this may help to achieve your requirement.
Regards,
Charlee Ch.
您的意思是您的网络服务受到“客户端证书”的保护?如果是,请从服务提供商处获取 .p12 (PFX) 或密钥库格式的证书,并在调用之前使用以下系统属性进行设置:
javax.net.ssl.keyStore - 路径到服务器上的密钥库
javax.net.ssl.keyStorePassword - 该密钥库的密码
javax.net.ssl.keyStoreType - 将其设置为“pkcs12”是提供给您的客户端证书。p12
如果您的应用程序仅是一个 Web 服务提供商的客户端,请将这些属性设置为 VM 参数,如果不是,您可能需要为每个安全端点创建特定的 SSLConnectionFactory。有关创建自定义的详细信息,请参阅我对此帖子的回复SSL 套接字工厂。
You mean your web service is protected with a "client certificate"? If yes, get the certificate in either a .p12 (PFX) or keystore format from the service provider and use the following System properties to set it before your call:
javax.net.ssl.keyStore - Path to the keystore on your server
javax.net.ssl.keyStorePassword - passphrase for that keystore
javax.net.ssl.keyStoreType - Set it to "pkcs12" is the client certificate provided to you is .p12
If you application is client to only one web service provider, set these properties as VM arguments, if not, you may need to create specific SSLConnectionFactory for each secured endpoint. Refer to my response on this post for details on creating custom SSL Socket Factories.