【发布时间】:2011-10-06 04:25:36
【问题描述】:
我做了以下事情:
+ generate keystore.jks with keytool
+ exported keystore.cer file with keytool
+ imported keystore.cer file into truststore.jks
+ copied keystore.jks and keystore.cer to the client
然后我调用我的服务器
-Djavax.net.ssl.trustStore=truststore.jks -Djavax.net.ssl.trustStorePassword=*
和我的客户
-Djavax.net.ssl.keyStore=forclient.jks -Djavax.net.ssl.keyStorePassword=*
服务器通过 UnicastRemoteObject 的 super() 调用公开其接口
super(PORT,
new SslRMIClientSocketFactory(),
new SslRMIServerSocketFactory(null, null, true));
注册表的东西不使用任何 SSL。为什么这行不通? 如果我在服务器运行配置中添加密钥库 VM 参数并在客户端中添加信任库 VM 参数,它确实有效。但我真的很想知道为什么?
【问题讨论】:
-
它不起作用不是有用的错误描述。
-
好的,SLL 握手不起作用。
-
@WorstCase 这没什么用。使用 -Djavax.net.debug=ssl,handshake 运行时发布异常、堆栈跟踪和输出。