pteich / elastic-query-export

🚚 Export Data from ElasticSearch to CSV/JSON using a Lucene Query (e.g. from Kibana) or a raw JSON Query string
MIT License
89 stars 18 forks source link

Looks like -verifySSL is not doing anything #22

Closed herrbpl closed 1 month ago

herrbpl commented 1 year ago

Cannot query elasticsearch instance where certificate is self-signed ad-or does not match hostname. Specifying -verifySSL false or -verifySSL 0 or just without parameter, seems to have no effect, still get message:

 Error connecting to ElasticSearch: health check timeout: Head "https://x.y.z:9200": x509: certificate is valid for a.b.c, not x.y.z: no Elasticsearch node available
herrbpl commented 1 year ago

In fact, specifying -verifySSL seems to stop processing command line arguments at all. If you specify this flag before -c url, application tries to connect to localhost:9200..

pteich commented 1 year ago

You need to pass --verifySSL=true or --verifySSL=false to toggle verifying SSL certificates or not. In the end this sets the "skip verify" of provided certificates in the HTTP client. I will improve the docs for pointing this out :)