首页 > 解决方案 > 带有 tls 的 Elasticsearch 集群

问题描述

我在 kubernetes 上设置了一个 ELK 集群(6.8)及其工作。我用 TLS 配置它:

 xpack.security.transport.ssl.enabled: true
 xpack.security.transport.ssl.verification_mode: "certificate"
 xpack.security.transport.ssl.keystore.path: /usr/share/elasticsearch/config/certs/certificate.p12
 xpack.security.transport.ssl.truststore.path: /usr/share/elasticsearch/config/certs/certificate.p12

使用工具 elasticsearch-certutil 并遵循本指南创建了证书.p12 文件:https ://www.elastic.co/guide/en/elasticsearch/reference/6.8/configuring-tls.html#node-certificates

使用此配置,一切正常,没有问题。麋鹿节点可以相互通信。

现在我想使用我们公司的另一个认证问题。该证书采用 p12 格式,也用于其他应用程序:例如,在 Spring Boot 中启用 https,或在 Kibana (xpack_security_http_keystore_path) 中始终启用 http,但我认为我遗漏了一些东西。我需要做一些特定的事情才能使用该证书吗?我试过了,但我在启动时遇到了这个异常:

exception caught on transport layer [Netty4TcpChannel], closing connection
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Empty server certificate chain
Caused by: javax.net.ssl.SSLHandshakeException: Empty server certificate chain

如何在 ELK 中使用我公司的 p12 证书来启用 xpack.security.transport.ssl?

标签: elasticsearchssl

解决方案


assume your company's certificate is mycompany.ca.crt, you will have that crt on elasticsearch node and have this configuration in your elasticsearch.yml file

xpack.security.http.ssl.certificate: path/to/my/cert/wildcard.mycompany.cert
xpack.security.http.ssl.certificate_authorities: ["path/to/my/cert/mycompany.ca.cert"]

also follow this link if you have not already https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup-https.html


推荐阅读