我正在尝试使用 elastic4s-http vis https 连接到 Elasticsearch,但找不到使用 https 而不是 http 的方法。
我目前正在使用:
HttpClient(ElasticsearchClientUri(config.getString("services.elasticsearch.host"), config.getInt("services.elasticsearch.port")))
连接到实例。
当我在日志中看到这一点时,我似乎正在建立连接:
INFO com.sksamuel.elastic4s.http.HttpClient$ - 在http://host:port上创建 HTTP 客户端
调试 com.sksamuel.elastic4s.http.search.SearchImplicits$SearchHttpExecutable$ - 执行搜索请求:{"query":{"match":{"status":{"query":"Listed"}}}}
调试 com.sksamuel.elastic4s.http.search.SearchImplicits$SearchHttpExecutable$ - 执行弹性请求 POST:/myindex/_search?
调试 com.sksamuel.elastic4s.http.search.SearchImplicits$SearchHttpExecutable$ - {"query":{"match":{"status":{"query":"Listed"}}}}```
但后来我明白了:
java.io.IOException: Connection reset by peer
并且不返回任何响应。
关于如何让 https 工作的任何建议都会很棒,谢谢