elasticsearchr icon indicating copy to clipboard operation
elasticsearchr copied to clipboard

Secure connection [x-pack]

Open regisoc opened this issue 6 years ago • 2 comments

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: image

regisoc avatar Oct 11 '19 14:10 regisoc

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.

AlexIoannides avatar Oct 13 '19 20:10 AlexIoannides

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

peterschretlen avatar Dec 31 '19 21:12 peterschretlen