Check out example codes for "java ssl". It will help you in understanding the concepts better.

Code Example 1

String host = getHost(...);Integer port = getPort(...);SSLSocketFactory sslsocketfactory = SSLSocketFactory.getDefault();SSLSocket sslsocket = (SSLSocket) sslsocketfactory  .createSocket(host, port);InputStream in = sslsocket.getInputStream();OutputStream out = sslsocket.getOutputStream(); out.write(1);while (in.available() > 0) {    System.out.print(in.read());} System.out.println("Secured connection performed successfully");

Learn ReactJs, React Native from akashmittal.com