Request to containerized OpenSearch without curl flags

Viewed 83

I can interact with my open search docker container via curl -XGET https://localhost:9200 -u 'admin:admin' --insecure but no use when I want to automate requests to it... I need to be able to access it, even via HTTP is fine (not secure meaning not HTTPS).

command:

curl -XGET https://localhost:9200

error:
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

I did go into that link, not a solution, just an explanation that threw me into a rabbit hole I was able to get out just now.

The awful thing is that this happened to me before and I fixed it, but it was not on a docker container and I don't remember how I fixed it.

1 Answers

You can disable security in your Dockerfile then:

RUN echo "plugins.security.disabled: true" >> /usr/share/opensearch/config/opensearch.yml

Your OpenSearch will be accessible via http://localhost:9200 after. I do this to setup my data, and then load /usr/share/opensearch/data in an other container set up with security.

Related