Skip to content

Commit 5498402

Browse files
committed
address codeql warnings
1 parent fb6ae92 commit 5498402

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/DefaultHttpClientManagedIdentity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030
class DefaultHttpClientManagedIdentity extends DefaultHttpClient {
3131

32-
// CodeQL [SM03767] False positive: in addTrustedCertificateThumbprint() we create a TrustManager that only trusts a certificate with a specific thumbprint.
3332
public static final HostnameVerifier ALL_HOSTS_ACCEPT_HOSTNAME_VERIFIER = new HostnameVerifier() {
3433
@SuppressWarnings("BadHostnameVerifier")
3534
@Override
@@ -85,6 +84,8 @@ public static void addTrustedCertificateThumbprint(HttpsURLConnection httpsUrlCo
8584
String certificateThumbprint) {
8685
//We expect the connection to work against a specific server side certificate only, so it's safe to disable the
8786
// host name verification.
87+
88+
// CodeQL [SM03767] False positive: the TrustManager created later on will only trust a certificate with a specific thumbprint.
8889
if (httpsUrlConnection.getHostnameVerifier() != ALL_HOSTS_ACCEPT_HOSTNAME_VERIFIER) {
8990
httpsUrlConnection.setHostnameVerifier(ALL_HOSTS_ACCEPT_HOSTNAME_VERIFIER);
9091
}

0 commit comments

Comments
 (0)