code: public static TrustManager[] initializeTrustManagers(File _trustStoreFile, String _trustStorePassword) throws IOException {
          if (_trustStoreFile == null) {
              return null;
          }
  
          String storeType = getStoreTypeByFileName(_trustStoreFile);
  
          boolean derEncoded = storeType == STORETYPE_DER_ENCODED;
          if (derEncoded) {
              storeType = STORETYPE_JKS;
          }
  
          String trustStorePwd = StringUtil.defaultIfBlank(_trustStorePassword, System.getProperty("javax.net.ssl.trustStorePassword"));
  
          LOGGER.debug("Creating trust store of type '" + storeType + "' from " + (derEncoded ? "DER-encoded" : "") + " file '" + _trustStoreFile + "'");
  
          try {
              TrustManagerFactory trustMgrFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  
              KeyStore trustStore = KeyStore.getInstance(storeType);
              if (derEncoded) {
                  FileInputStream fis = new FileInputStream(_trustStoreFile);
                  X509Certificate certificate = (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(fis);
                  trustStore.load(null, null);
                  trustStore.setCertificateEntry("[der_cert_alias]", certificate);
              } else {
                  trustStore.load(new FileInputStream(_trustStoreFile), trustStorePwd != null ? trustStorePwd.toCharArray() : null);
              }
              trustMgrFactory.init(trustStore);
              return trustMgrFactory.getTrustManagers();
          } catch (GeneralSecurityException _ex) {
              throw new IOException("Error while setting up trustStore", _ex);
          }
      }
docs: Initialization of trustStoreManager used to provide access to the configured trustStore.
  
  @param _trustStoreFile trust store file
  @param _trustStorePassword trust store password
  @return TrustManager array or null
  @throws IOException on error