yunojuno/elasticsearch-django

TLS Certs

Closed this issue · 3 comments

Is there a way to configure elasticsearch-django to use local TLS certs? For local dev, I am running Elasticsearch and Kibana using the ES recommended docker-compose setup: https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html. django-elasticsearch-dsl had a couple of options where you could reference local certs (see: https://stackoverflow.com/questions/71281717/connecting-elasticsearch-to-django-using-django-elasticsearch-dsl-results-in-c).

Hi @ColeDCrawford - unfortunately not at the moment. We're very open to contributions though?

Sure, I can try a PR. Where should the additional settings live in SEARCH_SETTINGS? They are connection specific, but right now the SEARCH_SETTINGS.connections dict expects the key:value pairs to be str:str (key: ES URL). Should I modify SEARCH_SETTINGS.connections (and get_connection_string()) so connections should expect a dict with a connection string and other optional settings? Allow for either the basic string or a dict with those additional settings? Or how would you like to handle this?

@ColeDCrawford I think this is solved in your PR - if the connection settings is a dict it can contain anything that the client initialiser needs? I should have done this in the first place - thanks for highlighting it.