不知道你的Send 和Info具体是干嘛的,SSL是标准加密协议,一般情况下并不需要你另外写代码进行加密解密,只要配置好系统环境就可以了。
不过出现上面错误的原因一般是因为你的客户端keystore没有倒入服务端的证书。检查下你的keystore的内容就知道了。
c:\\test\\myKeystore
不过出现上面错误的原因一般是因为你的客户端keystore没有倒入服务端的证书。检查下你的keystore的内容就知道了。
c:\\test\\myKeystore
解决方案 »
- java代码 调用linux 中的 .so文件加载不到请高人指点
- 用java输出N的图如9,16,25,36,49,下面是64的图
- JDK1.4中如何将int数组转化成integer数组?
- 关于spring 自动扫描和注册Bean组件的问题
- 哪位有中文版的<<如何像计算机科学家一样思考>>E书或PDF文档?
- SOS~ 在关键字 'user' 附近有语法错误。
- 各位大虾救救我!我用JavaMail发邮件老出错,请各位指点一下
- 如何用JBUILDER中的一个变量和SQL中的一个表进行逐行比较并返回一个布尔值,多谢!
- EJB方面的知识有谁懂,EJB跟JSP 中插入JAVA BEAN 有何区别。
- 用JAVA实现聊天
- 请问:如何实现文件日志功能?要求每天换一个文件。文件名以日期区分
- jboss + tomcat 下不能显示中文怎么办啊?
因为,如果我单独象一台机器发送,那么没有问题.只有同时向两台机器发送数据,那么回出现问题.
I use keytool to generate certificate, with the certificate,I can send data to one computer without any error. Only when I send data to more than one computer ,such as two computer ,in the same time ,it will be error.may be when I send data to two computer the same time, then system initialized ,and catched the first certification content ,and when I send the data to other computer ,system still use the first certificate, so get a error say that “No trusted certificate found”. I don’t know is it for this reason.After I use System.setProperty("javax.net.debug","all"); I can see this Information:
For first send will show :
keyStore is :
keyStore type is : jks
init keystore
init keymanager of type SunX509
trustStore is: c:\t\myKeystore
trustStore type is : jks
init truststore
adding as trusted cert:
Subject: CN=a, OU=b, O=c, L=d, ST=e, C=f
Issuer: CN=a, OU=b, O=c, L=d, ST=e, C=f
Algorithm: RSA; Serial number: 0x40c67e6c
Valid from Wed Jun 09 11:05:16 CST 2004 until Tue Sep 07 11:05:16 CST 2004init context
trigger seeding of SecureRandom
done seeding SecureRandombut when the second send it will not be shown.
Why ??
其实你只要设2个系统参数即可:
System.setProperty("javax.net.ssl.trustStore", "yourTrustStoreFileName");
System.setProperty("javax.net.ssl.trustStorePassword", "yourTrustStorePassword");
你把其他的代码去掉看看,只设这两个参数。
奇怪,你一个客户端为甚么要用2个 keystore,只要用一个keystore然后倒入
2个服务端的证书不是就可以了吗
I change it and use only one certification ,just copy one certification to two computer.it's ok!
---thanks very much!