Search Guard error

I am running the below configuration

Elastic Search : 5.5.0

Spring Data Elastic Search : 3.0.0.RC2

Search Guard : 5.5.0-15

I have followed the steps mentioned in https://github.com/floragunncom/search-guard and my elastic search is protected by https and challenges for password while trying to access from browser ( default admin/admin )

When I try to connect to the elastic search using the below code

                Settings esSettings = Settings.builder()
.put("path.home", ".")
.put("cluster.name", "searchguard_demo")
.put("searchguard.ssl.transport.enabled", true)
.put("searchguard.ssl.transport.keystore_filepath", "kirk-keystore.jks")
.put("searchguard.ssl.transport.truststore_filepath", "truststore.jks")
.put("searchguard.ssl.transport.enforce_hostname_verification", false)
.put("request.headers.sg.impersonate.as", "admin")
.build();
TransportClient client = new PreBuiltTransportClient(esSettings);
try {
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), Integer.valueOf("9300")));
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
client.threadPool().getThreadContext().putHeader("Authorization", "Basic "+ Base64.encodeBase64("admin:admin".getBytes()));

I get the following error

    Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:293)
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:256)
at org.elasticsearch.common.settings.SettingsModule.<init>(SettingsModule.java:139)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:138)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:265)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:130)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:116)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:106)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch.client(LearnElasticSearch.java:72)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3.CGLIB$client$2(<generated>)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3$$FastClassBySpringCGLIB$$f89f44e5.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:359)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3.client(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:155)
... 65 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.enforce_hostname_verification] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.keystore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.truststore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more

The elasticsearch.yml has the search guard settings in the config directory.

kindly revert if I am doing any mistake here.

This is the cause of the problem:

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transportenabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

Which means that you forgot to add the Search Guard SSL plugin to your transport client:

 TransportClient client = new PreBuiltTransportClient(esSettings, SearchGuardPlugin.class);

The plugin must be on the classpath of course. Also, use absolute paths for the key- and truststores in your settings.

···

On Saturday, August 12, 2017 at 10:08:12 PM UTC+2, md md wrote:

I am running the below configuration

Elastic Search : 5.5.0

Spring Data Elastic Search : 3.0.0.RC2

Search Guard : 5.5.0-15

I have followed the steps mentioned in https://github.com/floragunncom/search-guard and my elastic search is protected by https and challenges for password while trying to access from browser ( default admin/admin )

When I try to connect to the elastic search using the below code

                Settings esSettings = Settings.builder()
.put("path.home", ".")
.put("[cluster.name](http://cluster.name)                ", "searchguard_demo")
.put("searchguard.ssl.                transport.enabled", true)
.put("searchguard.ssl.                transport.keystore_filepath", "kirk-keystore.jks")
.put("searchguard.ssl.transport.truststore_filepath"                , "truststore.jks")
.put("searchguard.ssl.transport.enforce_hostname_                verification", false)
.put("[request.headers.sg.impersonate.as](http://request.headers.sg.impersonate.as)                ", "admin")
.build();
TransportClient client = new PreBuiltTransportClient(
        esSettings);
try {
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.        0.1"), Integer.valueOf("9300")));
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
client.threadPool().getThreadContext().putHeader("Authorization", "Basic "+ Base64.encodeBase64("admin:admin".getBytes()));

I get the following error

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.    enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    293)
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    256)
at org.elasticsearch.common.settings.SettingsModule.<init>    (SettingsModule.java:139)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.    java:138)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:    265)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    130)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    116)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    106)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch.client(    LearnElasticSearch.java:72)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3.CGLIB$client$2(<    generated>)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3$$FastClassBySpringCGLIB$$    f89f44e5.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(    MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.    java:359)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$    1db7aec3.client(<generated>)
at sun.reflect.NativeMethodAccessorImpl.    invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:    62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.    java:43)
at java.lang.reflect.Method.    invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.    java:155)
... 65 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        enforce_hostname_verification] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        keystore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        truststore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more

The elasticsearch.yml has the search guard settings in the config directory.

kindly revert if I am doing any mistake here.

Thanks for the guidance. Will try as suggested and revert.

···

On Saturday, August 12, 2017 at 11:35:44 PM UTC+3, Jochen Kressin wrote:

This is the cause of the problem:

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transportenabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

Which means that you forgot to add the Search Guard SSL plugin to your transport client:

 TransportClient client = new PreBuiltTransportClient(esSettings, SearchGuardPlugin.class);

The plugin must be on the classpath of course. Also, use absolute paths for the key- and truststores in your settings.

On Saturday, August 12, 2017 at 10:08:12 PM UTC+2, md md wrote:

I am running the below configuration

Elastic Search : 5.5.0

Spring Data Elastic Search : 3.0.0.RC2

Search Guard : 5.5.0-15

I have followed the steps mentioned in https://github.com/floragunncom/search-guard and my elastic search is protected by https and challenges for password while trying to access from browser ( default admin/admin )

When I try to connect to the elastic search using the below code

                Settings esSettings = Settings.builder()
.put("path.home", ".")
.put("[cluster.name](http://cluster.name)                ", "searchguard_demo")
.put("searchguard.ssl.                transport.enabled", true)
.put("searchguard.ssl.                transport.keystore_filepath", "kirk-keystore.jks")
.put("searchguard.ssl.transport.truststore_filepath"                , "truststore.jks")
.put("searchguard.ssl.transport.enforce_hostname_                verification", false)
.put("[request.headers.sg.impersonate.as](http://request.headers.sg.impersonate.as)                ", "admin")
.build();
TransportClient client = new PreBuiltTransportClient(
        esSettings);
try {
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.        0.1"), Integer.valueOf("9300")));
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
client.threadPool().getThreadContext().putHeader("Authorization", "Basic "+ Base64.encodeBase64("admin:admin".getBytes()));

I get the following error

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.    enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    293)
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    256)
at org.elasticsearch.common.settings.SettingsModule.<init>    (SettingsModule.java:139)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.    java:138)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:    265)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    130)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    116)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    106)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch.client(    LearnElasticSearch.java:72)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3.CGLIB$client$2(<    generated>)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3$$FastClassBySpringCGLIB$$    f89f44e5.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(    MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.    java:359)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$    1db7aec3.client(<generated>)
at sun.reflect.NativeMethodAccessorImpl.    invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:    62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.    java:43)
at java.lang.reflect.Method.    invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.    java:155)
... 65 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        enforce_hostname_verification] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        keystore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        truststore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more

The elasticsearch.yml has the search guard settings in the config directory.

kindly revert if I am doing any mistake here.

Thanks . After I specified the plugin , the previous error is not happening now.

I get the below error while trying to connect to elastic search

Exception in thread “main” NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{k9GHQ0TLS168pbJSZH8QRA}{127.0.0.1}{127.0.0.1:9300}]]

at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347)

at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:245)

at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)

at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:363)

at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408)

at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:397)

at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1250)

at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.exists(AbstractClient.java:1272)
···

On Saturday, August 12, 2017 at 11:35:44 PM UTC+3, Jochen Kressin wrote:

This is the cause of the problem:

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transportenabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

Which means that you forgot to add the Search Guard SSL plugin to your transport client:

 TransportClient client = new PreBuiltTransportClient(esSettings, SearchGuardPlugin.class);

The plugin must be on the classpath of course. Also, use absolute paths for the key- and truststores in your settings.

On Saturday, August 12, 2017 at 10:08:12 PM UTC+2, md md wrote:

I am running the below configuration

Elastic Search : 5.5.0

Spring Data Elastic Search : 3.0.0.RC2

Search Guard : 5.5.0-15

I have followed the steps mentioned in https://github.com/floragunncom/search-guard and my elastic search is protected by https and challenges for password while trying to access from browser ( default admin/admin )

When I try to connect to the elastic search using the below code

                Settings esSettings = Settings.builder()
.put("path.home", ".")
.put("[cluster.name](http://cluster.name)                ", "searchguard_demo")
.put("searchguard.ssl.                transport.enabled", true)
.put("searchguard.ssl.                transport.keystore_filepath", "kirk-keystore.jks")
.put("searchguard.ssl.transport.truststore_filepath"                , "truststore.jks")
.put("searchguard.ssl.transport.enforce_hostname_                verification", false)
.put("[request.headers.sg.impersonate.as](http://request.headers.sg.impersonate.as)                ", "admin")
.build();
TransportClient client = new PreBuiltTransportClient(
        esSettings);
try {
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.        0.1"), Integer.valueOf("9300")));
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
client.threadPool().getThreadContext().putHeader("Authorization", "Basic "+ Base64.encodeBase64("admin:admin".getBytes()));

I get the following error

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.    enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    293)
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    256)
at org.elasticsearch.common.settings.SettingsModule.<init>    (SettingsModule.java:139)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.    java:138)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:    265)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    130)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    116)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    106)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch.client(    LearnElasticSearch.java:72)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3.CGLIB$client$2(<    generated>)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3$$FastClassBySpringCGLIB$$    f89f44e5.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(    MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.    java:359)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$    1db7aec3.client(<generated>)
at sun.reflect.NativeMethodAccessorImpl.    invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:    62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.    java:43)
at java.lang.reflect.Method.    invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.    java:155)
... 65 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        enforce_hostname_verification] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        keystore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        truststore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more

The elasticsearch.yml has the search guard settings in the config directory.

kindly revert if I am doing any mistake here.

It was a mistake from my end. I dont have any impersonate_dn configured in search guard and I need not pass the authorization header as well.

The below code works . I am using the demo installer script to test.

Settings esSettings = Settings.builder()

         .put("path.home", ".")

         .put("cluster.name", "searchguard_demo")

         .put("searchguard.ssl.transport.enabled", true)

         .put("searchguard.ssl.transport.keystore_filepath", "/Users/temp/Desktop/applications/mycert/kirk.jks")

         .put("searchguard.ssl.transport.truststore_filepath", "/Users/temp/Desktop/applications/mycert/truststore.jks")

         .put("searchguard.ssl.transport.enforce_hostname_verification", false)

         .put("searchguard.ssl.transport.resolve_hostname", false)

         .put(SSLConfigConstants.SEARCHGUARD_SSL_TRANSPORT_KEYSTORE_PASSWORD, "changeit")

         .put(SSLConfigConstants.SEARCHGUARD_SSL_TRANSPORT_TRUSTSTORE_PASSWORD, "changeit")

         .putArray("searchguard.authcz.admin_dn", "CN=kirk,OU=client,O=client,l=Est,C=De")

         .build();

TransportClient client = new PreBuiltTransportClient(esSettings,SearchGuardPlugin.class);

try {

client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(“127.0.0.1”), Integer.valueOf(“9300”)));

} catch (NumberFormatException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (UnknownHostException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

``

···

On Tuesday, August 15, 2017 at 12:56:40 PM UTC+3, md md wrote:

Thanks . After I specified the plugin , the previous error is not happening now.

I get the below error while trying to connect to elastic search

Exception in thread “main” NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{k9GHQ0TLS168pbJSZH8QRA}{127.0.0.1}{127.0.0.1:9300}]]

at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347)

at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:245)

at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)

at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:363)

at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408)

at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:397)

at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1250)

at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.exists(AbstractClient.java:1272)

On Saturday, August 12, 2017 at 11:35:44 PM UTC+3, Jochen Kressin wrote:

This is the cause of the problem:

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transportenabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

Which means that you forgot to add the Search Guard SSL plugin to your transport client:

 TransportClient client = new PreBuiltTransportClient(esSettings, SearchGuardPlugin.class);

The plugin must be on the classpath of course. Also, use absolute paths for the key- and truststores in your settings.

On Saturday, August 12, 2017 at 10:08:12 PM UTC+2, md md wrote:

I am running the below configuration

Elastic Search : 5.5.0

Spring Data Elastic Search : 3.0.0.RC2

Search Guard : 5.5.0-15

I have followed the steps mentioned in https://github.com/floragunncom/search-guard and my elastic search is protected by https and challenges for password while trying to access from browser ( default admin/admin )

When I try to connect to the elastic search using the below code

                Settings esSettings = Settings.builder()
.put("path.home", ".")
.put("[cluster.name](http://cluster.name)                ", "searchguard_demo")
.put("searchguard.ssl.                transport.enabled", true)
.put("searchguard.ssl.                transport.keystore_filepath", "kirk-keystore.jks")
.put("searchguard.ssl.transport.truststore_filepath"                , "truststore.jks")
.put("searchguard.ssl.transport.enforce_hostname_                verification", false)
.put("[request.headers.sg.impersonate.as](http://request.headers.sg.impersonate.as)                ", "admin")
.build();
TransportClient client = new PreBuiltTransportClient(
        esSettings);
try {
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.        0.1"), Integer.valueOf("9300")));
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
client.threadPool().getThreadContext().putHeader("Authorization", "Basic "+ Base64.encodeBase64("admin:admin".getBytes()));

I get the following error

Caused by: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.    enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    293)
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:    256)
at org.elasticsearch.common.settings.SettingsModule.<init>    (SettingsModule.java:139)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.    java:138)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:    265)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    130)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    116)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:    106)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch.client(    LearnElasticSearch.java:72)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3.CGLIB$client$2(<    generated>)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$1db7aec3$$FastClassBySpringCGLIB$$    f89f44e5.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(    MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.    java:359)
at com.javacodegeeks.spring.elasticsearch.LearnElasticSearch$$EnhancerBySpringCGLIB$$    1db7aec3.client(<generated>)
at sun.reflect.NativeMethodAccessorImpl.    invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:    62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.    java:43)
at java.lang.reflect.Method.    invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.    java:155)
... 65 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        enforce_hostname_verification] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        keystore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more
Suppressed: java.lang.IllegalArgumentException: unknown setting [searchguard.ssl.transport.        truststore_filepath] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
... 84 more

The elasticsearch.yml has the search guard settings in the config directory.

kindly revert if I am doing any mistake here.