I am using it in my code as follow. but can't understand what is the use of it.
URL url = new URL("https://expired.badssl.com/");//https://revoked.grc.com/
HttpsURLConnection urlConnection = (HttpsURLConnection)url.openConnection();
urlConnection.setHostnameVerifier(connection.getHostnameVerifier());
urlConnection.setSSLSocketFactory(connection.getSSLContext().getSocketFactory();
LineNumberReader lnr =
new LineNumberReader(new InputStreamReader(urlConnection.getInputStream()));
String line;
while (null != (line = lnr.readLine()))
System.out.println(line);