您的位置:首页 > 移动开发

类似 java -Djavax.net.debug=SSL,handshake,data,trustmanager MyApp 如何在Eclipse下运行

2016-08-26 14:11 495 查看
(http://blog.csdn.net/dgenerationx/article/details/3963356)

(http://bbs.csdn.net/topics/390132577)

如何在Eclipse执行 类似 JSSE 提供的 动态 debug 追踪模式

列:

     java -Djavax.net.debug=SSL,handshake,data,trustmanager

     首先确定这是一个属于运行时 VM 的一个参数, 且该参数是 -Djavax.net.debug=SSL,handshake,data,trustmanager, 所以接下来我们就需要将该参数加入到VM的Parameters里面去
click "Run" on the top menus
select "Run Configuration"
Switch to the "Arguments" tab on the right panel
Click "Certificates" under the panle "VM parameters"
Click "NEW"
Enter name as "java.net.debug", then enter the value "-Djavax.net.debug=SSL,handshake,data,trustmanager" 
Added the "java.net.debug" parameter into "VM parameters"
============================================================================

实际上就是通过 KeyStoreManager, TrustManager 创建 SSLContext 对象,再通过 SSLContext 对象创建 SSLSocketFactory 对象,并将 SSLSocketFactory 对象赋给 HttpsURLConnection 对象。

KeyStoreManager 管理着双向认证中的客户端证书库
TrustManager 管理着双向认证中服务端证书信任库,相当于浏览器中我知道该证书非 CA 签发,但我需要继续操作。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐