-1

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);
PonWer
  • 87
  • 1
  • 7
C.k.
  • 93
  • 2
  • 13

1 Answers1

1
https://expired.badssl.com/

has expired SSL certificate, used to test edge cases where you may encounter expired certificate while connecting to some website.

You can find more @ https://github.com/chromium/badssl.com

It provides other sub-domains as

self-signed.badssl.com to test self signed certificate related edge cases

mixed.badssl.com etc.

Atul Sharma
  • 9,397
  • 10
  • 38
  • 65