为什么会出现“java.net.SocketException:未找到jks”?
我将以下 VM 参数传递给在 Websphere 5.1.1 JRE 上运行的 WS 客户端应用程序,一个在 Windows XP 上运行,一个在 Linux 上运行,但得到不同的行为。
-Djavax.net.ssl.keyStore=./key.jks
-Djavax.net.ssl.keyStorePassword=abc
-Djavax.net.ssl.trustStore=./key.jks
-Djavax.net.ssl.trust=abc
-Djavax.net.ssl.trustStorePassword=abc
-Djava.protocol.handler.pkgs=com.ibm.net.ssl.internal.www.protocol
-Djavax.net.ssl.trustStoreType=JKS
-DtraceSettingsFile=trace.log
在 Windows 上一切正常,但在 Linux 上,我在 WS 客户端应该打开连接的地方遇到异常:
java.net.SocketException: jks not found
at javax.net.ssl.DefaultSSLSocketFactory.createSocket(Unknown Source)
at com.ibm.ws.webservices.engine.components.net.JSSESocketFactory.create(JSSESocketFactory.java:207)
at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$5.run(HTTP11Sender.java:1789)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$SocketPoolFactory.obtainSocket(HTTP11Sender.java:1781)
at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender.invoke(HTTP11Sender.java:185)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:87)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:255)
我错过了什么吗?
谢谢
彼得
I am passing the following VM arguments to a WS client application that runs on Websphere 5.1.1 JRE, one on Windows XP and one on Linux but get different behaviors.
-Djavax.net.ssl.keyStore=./key.jks
-Djavax.net.ssl.keyStorePassword=abc
-Djavax.net.ssl.trustStore=./key.jks
-Djavax.net.ssl.trust=abc
-Djavax.net.ssl.trustStorePassword=abc
-Djava.protocol.handler.pkgs=com.ibm.net.ssl.internal.www.protocol
-Djavax.net.ssl.trustStoreType=JKS
-DtraceSettingsFile=trace.log
On Windows all work fine, but on Linux I am getting an exception right where the WS client is supposed to open a connection:
java.net.SocketException: jks not found
at javax.net.ssl.DefaultSSLSocketFactory.createSocket(Unknown Source)
at com.ibm.ws.webservices.engine.components.net.JSSESocketFactory.create(JSSESocketFactory.java:207)
at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$5.run(HTTP11Sender.java:1789)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender$SocketPoolFactory.obtainSocket(HTTP11Sender.java:1781)
at com.ibm.ws.webservices.engine.transport.http.HTTP11Sender.invoke(HTTP11Sender.java:185)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:87)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:255)
Am I missing something?
Thanks
Peter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的 Linux 环境没有安装该软件包,那么硬编码字符串
com.ibm.net.ssl.internal.www.protocol
可能是导致问题的原因。您可能需要为您已部署的任何库找到合适的条目,或者部署 IBM 库。更新:我在这里找到了参考 IBM VM 版本可能会有所帮助:
That hard-coded string
com.ibm.net.ssl.internal.www.protocol
may be the cause of your problem if your Linux environment doesn't have the package installed. You might need to find a suitable entry for whatever libraries you do have deployed, or deploy the IBM lib.Update: I found this here with reference to IBM VM versions which might help: