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

(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里面去

  1. click "Run" on the top menus
  2. select "Run Configuration"
  3. Switch to the "Arguments" tab on the right panel
  4. Click "Certificates" under the panle "VM parameters"
  5. Click "NEW"
  6. Enter name as "java.net.debug", then enter the value "-Djavax.net.debug=SSL,handshake,data,trustmanager" 
  7. Added the "java.net.debug" parameter into "VM parameters"
============================================================================

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

KeyStoreManager 管理着双向认证中的客户端证书库
TrustManager 管理着双向认证中服务端证书信任库,相当于浏览器中我知道该证书非 CA 签发,但我需要继续操作。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值