mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
Java: Remove overlapping code
This commit is contained in:
@@ -48,31 +48,6 @@ public class UnsafeCertTrustTest {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the implementation of trusting all hostnames as an anonymous class
|
||||
*/
|
||||
public void testTrustAllHostnameOfAnonymousClass() {
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
|
||||
@Override
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
return true; // Noncompliant
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the implementation of trusting all hostnames as a variable
|
||||
*/
|
||||
public void testTrustAllHostnameOfVariable() {
|
||||
HostnameVerifier verifier = new HostnameVerifier() {
|
||||
@Override
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
return true; // Noncompliant
|
||||
}
|
||||
};
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(verifier);
|
||||
}
|
||||
|
||||
private static final X509TrustManager TRUST_ALL_CERTIFICATES = new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(final X509Certificate[] chain, final String authType)
|
||||
@@ -109,13 +84,6 @@ public class UnsafeCertTrustTest {
|
||||
}
|
||||
};
|
||||
|
||||
public static final HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER = new HostnameVerifier() {
|
||||
@Override
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
return true; // Noncompliant
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Test the endpoint identification of SSL engine is set to null
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user