private static void configureSSL(Configuration conf) {
    configureSSLDeprecated(conf); // TODO: Deprecate this method

    boolean useSSL = MetastoreConf.getBoolVar(conf, ConfVars.DBACCESS_USE_SSL);

    if (useSSL) {
      try {
        LOG.info("Setting SSL properties to connect to the database store");
        String trustStorePath = MetastoreConf.getVar(conf, ConfVars.DBACCESS_SSL_TRUSTSTORE_PATH).trim();
        // Specifying a truststore path is not necessary. If one is not provided, then the default Java truststore path will be used instead.
        if (!trustStorePath.isEmpty()) {
          System.setProperty(TRUSTSTORE_PATH_KEY, trustStorePath);
        } else {
          LOG.info(ConfVars.DBACCESS_SSL_TRUSTSTORE_PATH.toString() + " has not been set. Defaulting to jssecacerts, if it exists. Otherwise, cacerts.");
        }
        // If the truststore password has been configured and redacted properly using the Hadoop CredentialProvider API, then
        // MetastoreConf.getPassword() will securely decrypt it. Otherwise, it will default to being read in from the
        // configuration file in plain text.
        String trustStorePassword = MetastoreConf.getPassword(conf, ConfVars.DBACCESS_SSL_TRUSTSTORE_PASSWORD);
        if (!trustStorePassword.isEmpty()) {
          System.setProperty(TRUSTSTORE_PASSWORD_KEY, trustStorePassword);
        } else {
          LOG.info(ConfVars.DBACCESS_SSL_TRUSTSTORE_PASSWORD.toString() + " has not been set. Using default Java truststore password.");
        }
        // Already validated in MetaStoreConf
        String trustStoreType = MetastoreConf.getVar(conf, ConfVars.DBACCESS_SSL_TRUSTSTORE_TYPE);
        System.setProperty(TRUSTSTORE_TYPE_KEY, trustStoreType);
      } catch (IOException e) {
        throw new RuntimeException("Failed to set the SSL properties to connect to the database store.", e);
      }
    }
  }
Configure SSL encryption to the database store.

The following properties must be set correctly to enable encryption:

1. {@link MetastoreConf.ConfVars#DBACCESS_USE_SSL}
2. {@link MetastoreConf.ConfVars#CONNECT_URL_KEY}
3. {@link MetastoreConf.ConfVars#DBACCESS_SSL_TRUSTSTORE_PATH}
4. {@link MetastoreConf.ConfVars#DBACCESS_SSL_TRUSTSTORE_PASSWORD}
5. {@link MetastoreConf.ConfVars#DBACCESS_SSL_TRUSTSTORE_TYPE}

The last three properties directly map to JSSE (Java) system properties. The Java layer will handle enabling
encryption once these properties are set.

Additionally, {@link MetastoreConf.ConfVars#CONNECT_URL_KEY} must have the database-specific SSL flag in the connection URL.

@param conf configuration values
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java