+ private void initializeAuthValues(Properties props) {
+ setAuthUser(props.getProperty(ES_AUTH_USER));
+ Optional<String> passwordValue = Optional.ofNullable(props.getProperty(ES_AUTH_ENC));
+ if (passwordValue.isPresent()) {
+ setAuthPassword(Password.deobfuscate(passwordValue.get()));
+ }
+ if (useAuth()) {
+ authValue = "Basic " + Base64.getEncoder()
+ .encodeToString((getAuthUser() + ":" + getAuthPassword()).getBytes(StandardCharsets.UTF_8));
+ }
+ }
+
+ private void initializeHttpsProperties(Properties props) {
+ Optional<String> trustStoreFile = Optional.ofNullable(props.getProperty(ES_TRUST_STORE));
+ if (trustStoreFile.isPresent()) {
+ setTrustStore(SearchDbConstants.SDB_SPECIFIC_CONFIG + trustStoreFile.get());
+ }
+
+ Optional<String> passwordValue = Optional.ofNullable(props.getProperty(ES_TRUST_STORE_ENC));
+ if (passwordValue.isPresent()) {
+ setTrustStorePassword(Password.deobfuscate(passwordValue.get()));
+ }
+
+ Optional<String> keyStoreFile = Optional.ofNullable(props.getProperty(ES_KEY_STORE));
+ if (keyStoreFile.isPresent()) {
+ setKeyStore(SearchDbConstants.SDB_SPECIFIC_CONFIG + keyStoreFile.get());
+ }
+
+ passwordValue = Optional.ofNullable(props.getProperty(ES_KEY_STORE_ENC));
+ if (passwordValue.isPresent()) {
+ setKeyStorePassword(Password.deobfuscate(passwordValue.get()));
+ }
+ }
+
+ private void setUriScheme(String uriScheme) {
+ this.uriScheme = Optional.ofNullable(uriScheme).orElse(DEFAULT_URI_SCHEME);
+ }