Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1348,23 +1348,22 @@ private static String ddGetEnv(final String sysProp) {
}

private static boolean okHttpMayIndirectlyLoadJUL() {
if (isIBMSASLInstalled() || isACCPInstalled()) {
return true; // 'IBMSASL' and 'ACCP' crypto providers can load JUL when OkHttp accesses TLS
if (isCustomSecurityProviderInstalled() || isIBMSASLInstalled()) {
return true; // custom security providers may load JUL when OkHttp accesses TLS
}
if (isJavaVersionAtLeast(9)) {
return false; // JDKs since 9 have reworked JFR to use a different logging facility, not JUL
}
return isJFRSupported(); // assume OkHttp will indirectly load JUL via its JFR events
}

private static boolean isIBMSASLInstalled() {
return ClassLoader.getSystemResource("com/ibm/security/sasl/IBMSASL.class") != null;
private static boolean isCustomSecurityProviderInstalled() {
return ClassLoader.getSystemResource("META-INF/services/java.security.Provider") != null;
}

private static boolean isACCPInstalled() {
return ClassLoader.getSystemResource(
"com/amazon/corretto/crypto/provider/AmazonCorrettoCryptoProvider.class")
!= null;
private static boolean isIBMSASLInstalled() {
// need explicit check as this is installed without using the service-loader mechanism
return ClassLoader.getSystemResource("com/ibm/security/sasl/IBMSASL.class") != null;
}

private static boolean isJFRSupported() {
Expand Down
Loading