Skip to content

Commit e99c7a3

Browse files
committed
Fixed warning Unsafe hostname verification
1 parent b807cc7 commit e99c7a3

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

src/main/java/com/github/underscore/lodash/U.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,12 +2038,6 @@ public void checkServerTrusted(
20382038
}
20392039
}
20402040

2041-
static class NoHostnameVerifier implements javax.net.ssl.HostnameVerifier {
2042-
public boolean verify(String hostname, javax.net.ssl.SSLSession session) {
2043-
return true;
2044-
}
2045-
}
2046-
20472041
private static void setupConnection(
20482042
final java.net.HttpURLConnection connection,
20492043
final String method,
@@ -2067,8 +2061,6 @@ private static void setupConnection(
20672061
if (connection instanceof javax.net.ssl.HttpsURLConnection) {
20682062
((javax.net.ssl.HttpsURLConnection) connection)
20692063
.setSSLSocketFactory(new BaseHttpSslSocketFactory());
2070-
((javax.net.ssl.HttpsURLConnection) connection)
2071-
.setHostnameVerifier(new NoHostnameVerifier());
20722064
}
20732065
if (headerFields != null) {
20742066
for (final Map.Entry<String, List<String>> header : headerFields.entrySet()) {

src/test/java/com/github/underscore/lodash/LodashTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,6 @@ public void fetchPut() {
598598
// resultChain.item());
599599
}
600600

601-
@Test
602-
public void noHostnameVerifier() {
603-
new U.NoHostnameVerifier().verify("", (javax.net.ssl.SSLSession) null);
604-
}
605-
606601
@Test(expected = UnsupportedOperationException.class)
607602
public void fetchWrongUrl() {
608603
U.fetch("ttt");

0 commit comments

Comments
 (0)