-
Notifications
You must be signed in to change notification settings - Fork 728
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
Cannot use x-pack with certificates containing IPv6 addresses #640
Comments
I have written code to reproduce the problem locally without installing elasticsearch. See https://github.com/mattiasholmlund/test-elasticsearch-ipv6-tls |
Thanks for the reproduction @mattiasholmlund. I'm looking into upgrading agentkeepalive. The 3.0 changelog doesn't seem breaking to me, which probably means I'm missing something subtle... |
I tried looking at the changelog for agentkeepalive as well. The change from 2.2.0 to 3.0.0 was some more tests, they started emitting a 'close' event and import of code from node 7.2.1. The module copies parts of the node source-code and patches it, so I guess that the import of new code from node was the "big" change. But they don't seem to follow semantic versioning, because I can't find any breaking changes. The usage of agentkeepalive in this module (https://github.com/elastic/elasticsearch-js/blob/master/src/lib/connectors/http.js#L91) also matches the latest documentation for agentkeepalive, except that the keepAliveTimeout setting has been deprecated. But you already set freeSocketKeepAliveTimeout to the same value, so you can just remove keepAliveTimeout. (https://github.com/node-modules/agentkeepalive/blob/master/lib/agent.js#L22) |
Just released the upgrade in 14.2.0, let me know how it goes 😄 |
Thanks for the release. It works great. Now I just need to get Kibana working with the same setup, but I think I can download the release tar-file for kibana and then use npm to replace the version of the elasticsearch module in Kibana. |
You might have to do the node_modules replacement manually since we strip Kibana's deps in it's package.json to prevent npm from breaking non-standard things we do during the build step, but you should be able to make it work since you know what you're doing. Kibana 6.3 will ship with the new esjs version: elastic/kibana#17119 |
Steps to reproduce:
Expected result:
Actual result:
The problem is an issue in the agentkeepalive module: node-modules/agentkeepalive#53 That issue was resolved in agentkeepalive 3.4.1
Note that to test this you need a version of node that supports IPv6 addresses in certificates. This was added in node 8.10.0 and it is also available in a fairly recent 9.x release.
Connecting to an elasticsearch server over IPv6 without TLS works fine and x-pack with a TLS-certificate that contains an IPv4 address also works fine. The problem is only with TLS certificates that contain an IPv6 address. The problem is that url:s with IPv6 addresses are in the form https://[::1]:9200, i.e. with brackets around the address.
The text was updated successfully, but these errors were encountered: