尝试进行远程重新索引时Elasticsearch SSL密钥库出错

5vf7fwbs  于 2023-04-20  发布在  ElasticSearch
关注(0)|答案(1)|浏览(578)

我使用的是Elasticsearch 8.1.4。我试图执行远程重新索引,而远程ES已经被其他人配置了SSL。我能够获得远程ES的abc.p12证书,以及自动生成的密码(字母数字字符串)。
我不是很熟悉TLS/cert的概念,我有点困惑,我应该做什么。
我目前在/etc/elasticsearch/elasticsearch.yml中有以下配置。

reindex.remote.whitelist: ["x.x.x.x:9200"]
reindex.ssl.keystore.path: abc.p12

xpack.security.enabled: true
xpack.security.http.ssl.enabled: false

xpack.security.enrollment.enabled: true

xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/t.p12
  truststore.path: certs/t.p12

我把这一页作为参考。
我用abc.p12的代码覆盖了xpack.security.transport.ssl.keystore.secure_passwordxpack.security.transport.ssl.truststore.secure_password。但是,我得到了错误消息failed to load SSL configuration [xpack.security.transport.ssl] - cannot read configured [PKCS12] keystore (as a truststore) [/etc/elasticsearch/certs/t.p12] - this is usually caused by an incorrect password; (a keystore password was provided)
如果我没有覆盖这两个密码,那么我会得到另一个错误:cannot read configured [PKCS12] keystore [/etc/elasticsearch/abc.p12] - this is usually caused by an incorrect password
t.p12被以前的管理员用来从其他远程ES重新索引。我不确定是否需要提供自己的t.p12(或者它实际上是用来做什么的)。
我该怎么办?

b4qexyjb

b4qexyjb1#

我也遇到了这个错误,并遵循https://www.elastic.co/guide/en/elasticsearch/reference/8.7/security-basic-setup.html作为参考。错误是因为我没有输入密码“为证书创建密码并接受默认文件名”。虽然您可以将CA的密码留空,但我认为可能需要输入证书的密码。否则,我也收到了这个错误......这通常是由错误的密码引起的;(已提供密钥存储库密码)
然后还需要做这部分:如果您在创建节点证书时输入了密码,请运行以下命令将密码存储在Elasticsearch密钥库中:
./bin/elasticsearch-keystore addxpack.security.transport.ssl.keystore.secure_password ./bin/elasticsearch-keystore addxpack.security.transport.ssl.truststore.secure_password

相关问题