elasticsearchr
elasticsearchr copied to clipboard
Secure connection [x-pack]
We cannot connect to a secure ES.
To reproduce:
# get one docker version of ES with active security
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:5.6.16
# error, will not connect
curl -X GET http://localhost:9200
# ok, with default credentials
curl -X GET http://localhost:9200 --user elastic:changeme
Result:

New functionality required here. I doubt that it'd take much effort to pass the authentication details through to ES (via the httpr commands), but there is probably a small amount of design work required, too.
I think there is a workaround: set the authentication in the global httr config? It's not ideal if you're using httr elsewhere, but if elasticsearch is the only connection being made it will work ok:
httr::set_config(authenticate("elastic","changeme"))
elastic("https://localhost:9200", "mpg") %index% mpg