-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket hang up #285
Comments
I see a I see a bunch of requests in the above to looker.com which doesn't seem related. Neither of those is the error from the OpenSearch connection, care to try and add more information on what changed? |
@dblock Please pay attention to the first error, the second error is related to Here is some code snip to help you better understand the errors.
The error is coming from this line, the first execution line of opensearch which complain that
|
What version of the server are you talking to? Any errors on the server? Can we see the HTTP request/response log before the HUP? |
server version: opensearchproject/opensearch:2.2.0
api call which triggers the error: (this is the first api call, opensearch should use a lazy connection)
server side error: (seems SSL related error, but there is no error when using elasticsearch client with the same setting)
client side error:
Re-paste the client side error detail for better view: My
|
I'm getting the same error. Even a simple Reproduction: docker-compose.ymlversion: "2"
services:
opensearch:
image: opensearchproject/opensearch
environment:
- discovery.type=single-node
ports:
- "127.0.0.1:9200:9200"
- "127.0.0.1:9600:9600"
test.jsconst opensearch = require('@opensearch-project/opensearch')
const client = new opensearch.Client({
node: 'http://localhost:9200'
})
client.ping().catch(err => {
console.log(err)
}) I tried using an older version of OpenSearch and got the same result. |
My
|
I think I know where this confusion comes from. Opensearch has SSL enabled by default using self-signed certificates, unlike Elasticsearch that doesn’t include SSL by default. If you look at the output of
... and then
Then So, what is the value of |
Problem has been solved. I should read docs and source code example/test
cases carefully.
Just curious, why opensearch enable SSL by default? Seems that there is no
way to turn it off from JavaScript client side, aka, opensearch-js
…On Mon, Sep 5, 2022, 11:58 PM Daniel (dB.) Doubrovkine < ***@***.***> wrote:
I think I know where this confusion comes from. Opensearch has SSL enabled
by default using self-signed certificates, unlike Elasticsearch that
doesn’t include SSL by default.
If you look at the output of docker-compose up with the above file you'll
see this:
"/usr/share/opensearch/plugins/opensearch-security/tools/securityadmin.sh" -cd "/usr/share/opensearch/config/opensearch-security" -icl -key "/usr/share/opensearch/config/kirk-key.pem" -cert "/usr/share/opensearch/config/kirk.pem" -cacert "/usr/share/opensearch/config/root-ca.pem" -nhnv
... and then
t-opensearch-1 | [2022-09-05T15:55:11,780][INFO ][o.o.s.s.DefaultSecurityKeyStore] [64c7216ee7de] TLS Transport Client Provider : JDK
t-opensearch-1 | [2022-09-05T15:55:11,781][INFO ][o.o.s.s.DefaultSecurityKeyStore] [64c7216ee7de] TLS Transport Server Provider : JDK
t-opensearch-1 | [2022-09-05T15:55:11,781][INFO ][o.o.s.s.DefaultSecurityKeyStore] [64c7216ee7de] TLS HTTP Provider : JDK
t-opensearch-1 | [2022-09-05T15:55:11,782][INFO ][o.o.s.s.DefaultSecurityKeyStore] [64c7216ee7de] Enabled TLS protocols for transport layer : [TLSv1.3, TLSv1.2]
t-opensearch-1 | [2022-09-05T15:55:11,798][INFO ][o.o.s.s.DefaultSecurityKeyStore] [64c7216ee7de] Enabled TLS protocols for HTTP layer : [TLSv1.3, TLSv1.2]
Then curl --insecure -uadmin:admin -v https://localhost:9200 will work,
but not curl -uadmin:admin -v http://localhost:9200.
So, what is the value of config.OPENSEARCH_HOST above? It should be
https://....
—
Reply to this email directly, view it on GitHub
<#285 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW6Q2LIZWIAJ3UEXNWW44J3V4YKCDANCNFSM574RNFRQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Enabling SSL is part of a strategy to make OpenSearch secure by default to avoid things like https://www.techrepublic.com/article/thousands-of-unprotected-elasticsearch-databases-are-being-ransomed/. See opensearch-project/OpenSearch#2095 for details. Sending credentials over an unencrypted channel is just not ok. But if you want to disable SSL on the server, you can by removing the security configuration. Client then will work just fine without SSL. I don't recommend it. |
Hmm...
It is the official docker image of open search:2.2.0 includes the SSL
configuration by default. It is not easy to disable SSL by not modifying
the docker image. I will dig into it if necessary.
…On Tue, Sep 6, 2022, 10:49 PM Daniel (dB.) Doubrovkine < ***@***.***> wrote:
Enabling SSL is part of a strategy to make OpenSearch secure by default to
avoid things like
https://www.techrepublic.com/article/thousands-of-unprotected-elasticsearch-databases-are-being-ransomed/.
See opensearch-project/OpenSearch#2095
<opensearch-project/OpenSearch#2095> for
details. If you want to disable SSL on the server, you can by removing the
security configuration. Client then will work just fine without SSL. I
don't recommend it.
—
Reply to this email directly, view it on GitHub
<#285 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW6Q2LJ3XLQ6LSI2BXEUKX3V45KV5ANCNFSM574RNFRQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yes, you're right. The |
I'm a fresh. Just use it for local development. And not familiar with SSL.
Any material of SSL recommend for a starter?
…On Wed, Sep 7, 2022, 3:13 AM Daniel (dB.) Doubrovkine < ***@***.***> wrote:
Yes, you're right. The -min distribution doesn't have any configuration,
so you can build up from there. But I really don't think anyone should be
running any services without SSL enabled. What's your scenario?
—
Reply to this email directly, view it on GitHub
<#285 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW6Q2LJB2PJ77PHAQTTFYPTV46JU7ANCNFSM574RNFRQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
No specific recommendations on SSL, but even for local development I think it's pretty easy to just have it enabled. Good habits. |
I faced similar issue and based on the help provided above, it was a very simple change at my end. My dev setup was a docker cluster of 3 opensearch nodes. Not working code:
Working code:
|
Socket hang up when using with opensearch:2.2.0 but elasticsearch works OK
The text was updated successfully, but these errors were encountered: