External Elastic search authentication

Hi,

I would like to use my own Elasticsearch cluster.
I have the environment variable as

ES_HTTP_URL=http://elastic:mypassword@myelasticsearch:9200

But I am getting an error when launching Fess :

Suppressed: org.codelibs.elasticsearch.client.action.HttpAction$CurlResponseException: {"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_cluster/health/?wait_for_no_relocating_shards=false&wait_for_no_initializing_shards=false&wait_for_nodes=&wait_for_status=yellow&wait_for_active_shards=0&wait_for_active_shards=0&timeout=30s&master_timeout=30s]","header":{"WWW-Authenticate":["ApiKey","Basic realm=\"security\" charset=\"UTF-8\""]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_cluster/health/?wait_for_no_relocating_shards=false&wait_for_no_initializing_shards=false&wait_for_nodes=&wait_for_status=yellow&wait_for_active_shards=0&wait_for_active_shards=0&timeout=30s&master_timeout=30s]","header":{"WWW-Authenticate":["ApiKey","Basic realm=\"security\" charset=\"UTF-8\""]}},"status":401}

Please can you assist ?

Thank you

Please try to add elasticsearch.username and elasticsearch.password to esclient.xml.
The example is:

...    
            <property name="settings">
                    {"http.cors.enabled":"true",
                     "elasticsearch.username":"...",
                     "elasticsearch.password":"...",

Hello @shinsuke , thank your reply.

I modified the file in /usr/share/fess/app/WEB-INF/classes/esclient.xml with

 <property name="settings">
                        {"http.cors.enabled":"true",
                         "elasticsearch.username":"elastic",
                         "elasticsearch.password":"my-elastic-pwd",
                         "http.cors.allow-origin":"*",
                         "indices.breaker.total.limit":"100%",
                         "discovery.type":"single-node",
                         "action.auto_create_index":"-*"}
                </property>

and the file /etc/fess/fess_config.properties like this :

# Elasticsearch
elasticsearch.cluster.name=docker-cluster
elasticsearch.http.url=http://elastic:my-elastic-pwd@elasticsearch:9200
elasticsearch.username=elastic
elasticsearch.password=my-elastic-pwd

and in /usr/share/fess/bin/fess.in.sh

# External elasticsearch cluster
ES_HTTP_URL=http://elastic:my-elastic-pwd@elasticsearch:9200
ES_TRANSPORT_URL=elasticsearch:9300
FESS_DICTIONARY_PATH=/var/lib/elasticsearch/config/

I am still getting the same error. The authentication is not happening.

Anything else I could try ?

http://elastic:my-elastic-pwd@elasticsearch:9200

is not needed.

Same problem. It looks like the authentication credentials are not used.

Anything else I could check ?