使用 ssl 证书的 Elasticsearch https 和 Nest 客户端连接

Elasticsearch https and Nest client connection with ssl certificate

我正在尝试使用 https(使用 Safeguard)和 NEST 客户端实施 Elasticsearch 5.x。

我失败了,如何生成安装在服务器中的 Elasticsearch 的 X509 证书。

在下面找到一些代码link如何使用 X509 证书创建到 Elasticsearch 的 NEST 连接。

但我不知道如何实现。我需要了解以下内容:

  1. 如何生成 Elasticsearch 的 X509 证书5.x(Elasticsearch 安装在服务器中,可以通过一些 url 访问 https://elas:9300

  2. 上面link的回答中"path_to_cert"的值是多少(我理解是X509证书文件的路径)。它需要是共享路径或者证书需要包含在应用程序中

我尝试搜索所有网络,但仍然一无所知。请帮忙解决这个问题。

提前致谢。

您的问题不清楚是关于要配置的Elasticsearch 服务器,还是仅关于客户端。服务器是否已经 运行 SSL(是否可以在您建议的文件中的 https://elas:9300 ?). If no, then you need to create a java keystore containing a self-signed certificate (I suppose it's enough for your need). If already running in SSL and your question is only about the client, then store the certificate that you can get when browsing https://elas:9300 处访问 (path_to_cert)