java ssl调试打开ssl debug日志

版权声明:本文为博主原创文章,转载请加入源链接。 https://blog.csdn.net/kevin_mails/article/details/84559906

添加jvm 参数 

-Djavax.net.debug=ssl
或者
-Djavax.net.debug=all

all            turn on all debugging
ssl            turn on ssl debugging

The following can be used with ssl:

    record       enable per-record tracing
    handshake    print each handshake message
    keygen       print key generation data
    session      print session activity
    defaultctx   print default SSL initialization
    sslctx       print SSLContext tracing
    sessioncache print session cache tracing
    keymanager   print key manager tracing
    trustmanager print trust manager tracing
    pluggability print pluggability tracing

    handshake debugging can be widened with:
    data         hex dump of each handshake message
    verbose      verbose handshake message printing

    record debugging can be widened with:
    plaintext    hex dump of record plaintext
    packet       print raw SSL/TLS packets

在web容器(tomcat,jetty等)启动的应用,通常在启动脚本里配置

例如jetty: 

如在IDE里调试

eclipse:  

intellij idea:

 在IDE里进行调试的时候,因为是debug 会输出大量的信息到到console,console装载不下,会丢掉大部日志,这时我们可以考虑把日志输出到文件:

intellij idea: edit Configurations -> logs-> Save console output to file

扫描二维码关注公众号,回复: 4254393 查看本文章

猜你喜欢

转载自blog.csdn.net/kevin_mails/article/details/84559906