public CommonsHttpTransport(Settings settings, String host) { this(settings, new SecureSettings(settings), host); }
SSLSocketFactory(Settings settings, SecureSettings secureSettings) { sslProtocol = settings.getNetworkSSLProtocol(); keyStoreLocation = settings.getNetworkSSLKeyStoreLocation(); keyStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_KEYSTORE_PASS); keyStoreType = settings.getNetworkSSLKeyStoreType(); trustStoreLocation = settings.getNetworkSSLTrustStoreLocation(); trustStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_TRUST_STORE_PASS); trust = (settings.getNetworkSSLAcceptSelfSignedCert() ? new SelfSignedStrategy() : null); }
private void addHttpAuth(Settings settings, SecureSettings secureSettings, Object[] authSettings) { if (StringUtils.hasText(settings.getNetworkHttpAuthUser())) { HttpState state = (authSettings[1] != null ? (HttpState) authSettings[1] : new HttpState()); authSettings[1] = state; state.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(settings.getNetworkHttpAuthUser(), secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_HTTP_AUTH_PASS))); if (log.isDebugEnabled()) { log.info("Using detected HTTP Auth credentials..."); } } }
public NetworkClient(Settings settings, TransportFactory transportFactory) { this.settings = settings.copy(); this.secureSettings = new SecureSettings(settings); this.nodes = SettingsUtils.discoveredOrDeclaredNodes(settings); this.transportFactory = transportFactory; // shuffle the list of nodes so in case of failures, the fallback is spread Collections.shuffle(nodes); if (SettingsUtils.hasPinnedNode(settings)) { // move pinned node in front to be selected (only once) String pinnedNode = SettingsUtils.getPinnedNode(settings); if (log.isDebugEnabled()) { log.debug("Opening (pinned) network client to " + pinnedNode); } nodes.remove(pinnedNode); nodes.add(0, pinnedNode); } selectNextNode(); Assert.notNull(currentTransport, "no node information provided"); }
proxyUser = settings.getNetworkProxySocksUser(); if (StringUtils.hasText(secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_SOCKS_PASS))) { proxyPass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_SOCKS_PASS);
public CommonsHttpTransport(Settings settings, String host) { this(settings, new SecureSettings(settings), host); }
if (!StringUtils.hasText(secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_HTTPS_PASS))) { log.warn(String.format("HTTPS proxy user specified but no/empty password defined - double check the [%s] property", ConfigurationOptions.ES_NET_PROXY_HTTPS_PASS)); state.setProxyCredentials(AuthScope.ANY, new UsernamePasswordCredentials(settings.getNetworkProxyHttpsUser(), secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_HTTPS_PASS))); if (!StringUtils.hasText(secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_HTTP_PASS))) { log.warn(String.format("HTTP proxy user specified but no/empty password defined - double check the [%s] property", ConfigurationOptions.ES_NET_PROXY_HTTP_PASS)); state.setProxyCredentials(AuthScope.ANY, new UsernamePasswordCredentials(settings.getNetworkProxyHttpUser(), secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_HTTP_PASS)));
public CommonsHttpTransport(Settings settings, String host) { this(settings, new SecureSettings(settings), host); }
SSLSocketFactory(Settings settings, SecureSettings secureSettings) { sslProtocol = settings.getNetworkSSLProtocol(); keyStoreLocation = settings.getNetworkSSLKeyStoreLocation(); keyStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_KEYSTORE_PASS); keyStoreType = settings.getNetworkSSLKeyStoreType(); trustStoreLocation = settings.getNetworkSSLTrustStoreLocation(); trustStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_TRUST_STORE_PASS); trust = (settings.getNetworkSSLAcceptSelfSignedCert() ? new SelfSignedStrategy() : null); }
public CommonsHttpTransport(Settings settings, String host) { this(settings, new SecureSettings(settings), host); }
SSLSocketFactory(Settings settings, SecureSettings secureSettings) { sslProtocol = settings.getNetworkSSLProtocol(); keyStoreLocation = settings.getNetworkSSLKeyStoreLocation(); keyStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_KEYSTORE_PASS); keyStoreType = settings.getNetworkSSLKeyStoreType(); trustStoreLocation = settings.getNetworkSSLTrustStoreLocation(); trustStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_TRUST_STORE_PASS); trust = (settings.getNetworkSSLAcceptSelfSignedCert() ? new SelfSignedStrategy() : null); }
public NetworkClient(Settings settings, TransportFactory transportFactory) { this.settings = settings.copy(); this.secureSettings = new SecureSettings(settings); this.nodes = SettingsUtils.discoveredOrDeclaredNodes(settings); this.transportFactory = transportFactory; // shuffle the list of nodes so in case of failures, the fallback is spread Collections.shuffle(nodes); if (SettingsUtils.hasPinnedNode(settings)) { // move pinned node in front to be selected (only once) String pinnedNode = SettingsUtils.getPinnedNode(settings); if (log.isDebugEnabled()) { log.debug("Opening (pinned) network client to " + pinnedNode); } nodes.remove(pinnedNode); nodes.add(0, pinnedNode); } selectNextNode(); Assert.notNull(currentTransport, "no node information provided"); }
SSLSocketFactory(Settings settings, SecureSettings secureSettings) { sslProtocol = settings.getNetworkSSLProtocol(); keyStoreLocation = settings.getNetworkSSLKeyStoreLocation(); keyStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_KEYSTORE_PASS); keyStoreType = settings.getNetworkSSLKeyStoreType(); trustStoreLocation = settings.getNetworkSSLTrustStoreLocation(); trustStorePass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_SSL_TRUST_STORE_PASS); trust = (settings.getNetworkSSLAcceptSelfSignedCert() ? new SelfSignedStrategy() : null); }
public NetworkClient(Settings settings, TransportFactory transportFactory) { this.settings = settings.copy(); this.secureSettings = new SecureSettings(settings); this.nodes = SettingsUtils.discoveredOrDeclaredNodes(settings); this.transportFactory = transportFactory; // shuffle the list of nodes so in case of failures, the fallback is spread Collections.shuffle(nodes); if (SettingsUtils.hasPinnedNode(settings)) { // move pinned node in front to be selected (only once) String pinnedNode = SettingsUtils.getPinnedNode(settings); if (log.isDebugEnabled()) { log.debug("Opening (pinned) network client to " + pinnedNode); } nodes.remove(pinnedNode); nodes.add(0, pinnedNode); } selectNextNode(); Assert.notNull(currentTransport, "no node information provided"); }
private void addHttpAuth(Settings settings, SecureSettings secureSettings, Object[] authSettings) { if (StringUtils.hasText(settings.getNetworkHttpAuthUser())) { HttpState state = (authSettings[1] != null ? (HttpState) authSettings[1] : new HttpState()); authSettings[1] = state; state.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(settings.getNetworkHttpAuthUser(), secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_HTTP_AUTH_PASS))); if (log.isDebugEnabled()) { log.info("Using detected HTTP Auth credentials..."); } } }
public NetworkClient(Settings settings, TransportFactory transportFactory) { this.settings = settings.copy(); this.secureSettings = new SecureSettings(settings); this.nodes = SettingsUtils.discoveredOrDeclaredNodes(settings); this.transportFactory = transportFactory; // shuffle the list of nodes so in case of failures, the fallback is spread Collections.shuffle(nodes); if (SettingsUtils.hasPinnedNode(settings)) { // move pinned node in front to be selected (only once) String pinnedNode = SettingsUtils.getPinnedNode(settings); if (log.isDebugEnabled()) { log.debug("Opening (pinned) network client to " + pinnedNode); } nodes.remove(pinnedNode); nodes.add(0, pinnedNode); } selectNextNode(); Assert.notNull(currentTransport, "no node information provided"); }
private void addHttpAuth(Settings settings, SecureSettings secureSettings, Object[] authSettings) { if (StringUtils.hasText(settings.getNetworkHttpAuthUser())) { HttpState state = (authSettings[1] != null ? (HttpState) authSettings[1] : new HttpState()); authSettings[1] = state; state.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(settings.getNetworkHttpAuthUser(), secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_HTTP_AUTH_PASS))); if (log.isDebugEnabled()) { log.info("Using detected HTTP Auth credentials..."); } } }
private void addHttpAuth(Settings settings, SecureSettings secureSettings, Object[] authSettings) { if (StringUtils.hasText(settings.getNetworkHttpAuthUser())) { HttpState state = (authSettings[1] != null ? (HttpState) authSettings[1] : new HttpState()); authSettings[1] = state; state.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(settings.getNetworkHttpAuthUser(), secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_HTTP_AUTH_PASS))); if (log.isDebugEnabled()) { log.info("Using detected HTTP Auth credentials..."); } } }
proxyUser = settings.getNetworkProxySocksUser(); if (StringUtils.hasText(secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_SOCKS_PASS))) { proxyPass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_SOCKS_PASS);
proxyUser = settings.getNetworkProxySocksUser(); if (StringUtils.hasText(secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_SOCKS_PASS))) { proxyPass = secureSettings.getSecureProperty(ConfigurationOptions.ES_NET_PROXY_SOCKS_PASS);