private static @Nullable X509TrustManager getOperatingSystemTrustManager() {
    try {
      Collection<X509Certificate> additionalTrustedCertificates =
        OsCertificatesService.getInstance().getCustomOsSpecificTrustedCertificates();
      if (additionalTrustedCertificates.isEmpty()) {
        // don't nag developers, on jetbrains developer's machine this list is usually empty on MacOs and Windows
        if (!ApplicationManager.getApplication().isUnitTestMode()) {
          LOG.warn(
            "Received an empty list of custom trusted root certificates from the system. Check log above for possible errors, enable debug logging in category 'org.jetbrains.nativecerts' for more information");
        }
        return null;
      }

      X509TrustManager x509TrustManager = createTrustManagerFromCertificates(additionalTrustedCertificates);

      List<String> acceptedRoots =
        Arrays.stream(x509TrustManager.getAcceptedIssuers())
        .map(certificate -> certificate.getSubjectX500Principal().toString())
        .sorted()
        .toList();
      LOG.debug("Accepted trusted certificate roots from the system: \n" + StringUtil.join(acceptedRoots, "\n"));

      return x509TrustManager;
    }
    catch (Throwable exception) {
      LOG.error("Unable to build system trusted certificates manager, only JVM-bundled roots will be used: " + exception.getMessage(), exception);
      return null;
    }
  }
private static @Nullable X509TrustManager getOperatingSystemTrustManager()