Configuration of OpenID connect for Elasticsearch 7.14.1 is getting failed with trial version

I have installed latest elasticsearch and kibana (7.14.1) version using docker images. My setup is single-node elasticsearch.
Initiated trial version for 30 days and enabled https for elasticsearch using ssl certificates.
Configured native realm and active_directory realm. Authentication works fine .

I have keycloak running with http protocol running remotely.
Following document in the official site for single sign on configuration provided oidc realm settings in elasticsearch.yml .

Reference Link:

On restarting elasticsearch node I found the error which says to use https instead of http.

Find configuration files below:

elasticsearch.yml: "docker-cluster"

xpack.license.self_generated.type: trial true true true certificate "ca.crt" "elasticsearch-trial.crt" "elasticsearch-trial.key" "ca.crt" "elasticsearch-trial.crt" "elasticsearch-trial.key" DEBUG true
      enabled: true
      order: 0
      enabled: true
      order: 1
      domain_name: "example.coml"
      url: "ldap://"
        base_dn: "cn=users,dc=examplei,dc=com"
        base_dn: "cn=users,dc=examplei,dc=com"
      enabled: true
      order: 2
      rp.client_id: "elk-trial"
      rp.response_type: code
      rp.requested_scopes: "openid"
      rp.redirect_uri: "http://my-kibana:5601/api/security/oidc/callback"
      op.issuer: "http://my-openid:8080/auth/realms/my-realm"
      op.authorization_endpoint: "http://my-openid:8080/auth/realms/my-realm/protocol/openid-connect/auth"
      op.token_endpoint: "http://my-openid:8080/auth/realms/my-realm/protocol/openid-connect/token"
      op.jwkset_path: "http://my-openid:8080/auth/realms/my-realm/protocol/openid-connect/certs"
      op.userinfo_endpoint: "http://my-openid:8080/auth/realms/my-realm/protocol/openid-connect/userinfo"
      op.endsession_endpoint: "http://my-openid:8080/auth/realms/my-realm/protocol/openid-connect/logout"
      rp.post_logout_redirect_uri: "http://my-kibana:5601/security/logged_out"
      claims.principal: preferred_username

Elasticsearch container logs:

uncaught exception in thread [main]
java.lang.IllegalStateException: security initialization failed
Likely root cause: java.lang.IllegalArgumentException: The [http] protocol is not supported as it is insecure. Use [https] instead
        at org.elasticsearch.node.Node.lambda$new$18(
        at java.base/$7$1.accept(
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(
        at java.base/
        at java.base/
        at java.base/$ReduceOp.evaluateSequential(
        at java.base/
        at java.base/
        at org.elasticsearch.node.Node.<init>(
        at org.elasticsearch.node.Node.<init>(
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(
        at org.elasticsearch.bootstrap.Bootstrap.setup(
        at org.elasticsearch.bootstrap.Bootstrap.init(
        at org.elasticsearch.bootstrap.Elasticsearch.init(
        at org.elasticsearch.bootstrap.Elasticsearch.execute(
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(
        at org.elasticsearch.cli.Command.main(
        at org.elasticsearch.bootstrap.Elasticsearch.main(
        at org.elasticsearch.bootstrap.Elasticsearch.main(

I couldn't undersatnd the error log is due to openid provider or elasticsearch configuration??
Any suggestion is most welcome.

You need to use https for your SSO urls.

Thanks @legoguy1000 for the reply.

But my keycloak server is not ssl enabled. I have configured the same OpenID provider for Opendistro for Elasticsearch and it works fine.

Is it compulsory to use https protocol for openID connection in ELK setup?

Can't we try with insecure openID connection in ELK setup ?

OpenDistro is not the same as Elasticsearch due to the split in the code base. It's security code is different. I don't know if u can use SSO without ssl.

As already said, Opendistro uses a different security implementation.

I'm not sure if SSO works without https, but this line in your configuration will force https anyway: true

You could test it, remove or comment all the* lines from your configuration and check if you still got the error.

Thanks @leandrojmp for your suggestion.

No luck with that configuration. Still same error for http supported elasticsearch.

I think default SSO support is https in ELK setup.

I could see here as Elastic supports insecure openID connection.

(ELK Stack integration with Keycloak)

Can anyone suggest me on insecure connection??

They were using 7.5, I suspect that the code was updated to require secured connections.

We currently only mandate that the JWKS URL (op.jwkset_path) is an https one. The link you referenced is to a setup that uses a local file for the jwks and this is why it works. You can do the same, you can get the JWKS as file from Keycloack, bind mount it to your elasticsearch container and point your op.jwkset_path to that location

Thanks @ikakavas for the solution.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.