Posts

Showing posts from 2022

How to debug SSL handshake errors using java program?

Image
import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import java.io.InputStream; import java.io.OutputStream; public class SSLDebugClient {     public static void main(String[] args ) {         if ( args . length != 2) {             System. out .println( "Input values: " +SSLDebugClient. class .getName()+ " <host> <port>" );             System. exit (1);         }         try {             SSLSocketFactory sslSocketFactory = (SSLSocketFactory) SSLSocketFactory. getDefault ();             //arg0 for host and   arg1 for port             SSLSocket sslSocket = (SSLSocket) sslSocketFactory .createSocket( args [0], Integer. parseInt ( args [1]));             InputStream inputStream = sslSocket .get...