Closed dylanjcastillo closed 2 years ago
Hey @dylanjcastillo you need to set use_ssl to true and then the rest should be correct. By default the container forces SSL even though it’s using self signed certs.
Let me know if you still have issues after you try that.
That was it! Thank you, it's working now.
Awesome! It’s a pretty common issue with the client. I actually wonder if we could raise a specific exception to alert people to try and change the verify setting
Would either of you be up for creating an issue to change this default, and/or to drafting a PR?
Hey @wbeckler, yes, I'd be happy to! Seems like a good first issue to contribute
Faced same issue today when I tried to connect to local k3d open search cluster installed via helm. Setting use_ssl = True
indeed solved this issue.
What is the bug?
I cannot connect to a local development cluster using opensearch-py. If I use
curl
it works correctly.How can one reproduce the bug?
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:2.2.0
host = 'localhost' port = 9200 auth = ('admin', 'admin')
client = OpenSearch( hosts = [{'host': host, 'port': port}], http_auth = auth, use_ssl = False, verify_certs = False, ssl_assert_hostname = False, ssl_show_warn = False, ) client.info()
ConnectionError: ConnectionError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))) caused by: ProtocolError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))
[2022-08-30T13:56:34,254][ERROR][o.o.s.s.h.n.SecuritySSLNettyHttpServerTransport] [db120fd1fe80] Exception during establishing a SSL connection: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: