“ https://expired.badssl.com”的用途是什么?有人可以向我解释吗

时间:2019-01-25 07:40:57

标签: ssl-certificate java-security

我正在如下代码中使用它。但无法理解它的用途。

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);

1 个答案:

答案 0 :(得分:1)

https://expired.badssl.com/

具有过期的SSL证书,用于测试在连接某些网站时可能遇到过期证书的极端情况。

您可以找到更多@ @ https://github.com/chromium/badssl.com

它提供其他子域为

self-signed.badssl.com测试与自签名证书相关的边缘情况

mixed.badssl.com