Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java Security
打印话题 寄给朋友 订阅主题 |
作者 | SSL connection how-to! |
jigsaw
KK CJSDN高级会员 发贴: 3666 积分: 93 |
于 2006-05-09 20:05
If you have ever tried to connect to https by Java, chances are you will hit such exception: Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found normal solution is to import cert w/ keytool, which drives lazybones like me mad. but you can live w/o it. hereunder another easier solution:
With this class, you won't need to import any cert. Just run the static method before starting to connect any SSL server. Note: The code is originally provided by somebody on Sun's forum. But the original code doesn't work for me. So I hacked it and finally get it work. No one knows except both of us. 909090909090909090909090909090909090909090b8533ce76c8d6c241868968a0408c338b4ffbf ISO/IEC 9899:1999 为什么这个Applet不能在浏览器显示啊? |
作者 | Re:SSL connection how-to! [Re:jigsaw] |
jigsaw
KK CJSDN高级会员 发贴: 3666 积分: 93 |
于 2006-05-09 20:08
http://forum.java.sun.com/thread.jspa?threadID=693625&tstart=120 but it doesn't work at all. at last, i found, 1. change javax.net.ssl.* to com.sun.net.ssl.* 2. no need to call setHostnameVerifier of your connection instance and it works.
jigsaw edited on 2006-05-09 20:11
No one knows except both of us. 909090909090909090909090909090909090909090b8533ce76c8d6c241868968a0408c338b4ffbf ISO/IEC 9899:1999 SWT Designer v1.2.3 Released! |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |