Java enable SSL debug (include spring-boot:run)
Post Date: 2024-05-05
- JVM Argument (non-springboot:run)
For Java program which is not calling via spring-boot:run,
you can add JVM argument -Djavax.net.debug=ssl:handshake:keymanager:trustmanager to enable the SSL debug.
- For spring-boot:run program
For spring-boot:run program,
you can add argument -Dspring-boot.run.jvmArguments="-Djavax.net.debug=ssl:handshake:keymanager:trustmanager" to enable the SSL debug or you can declare it inside code as below.
System.setProperty("javax.net.debug", "ssl:handshake:keymanager:trustmanager")
References:
- Debugging SSL/TLS Connections
- Enabling SSL debugging in a standalone Java program
- Maven spring boot run debug with arguments