1. 开启ES的HTTPS
#修改elasticsearch.yml 开启https
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.http.ssl.truststore.path: certs/elastic-certificates.p12
2. 生成证书
#方法一
#生成pem
openssl pkcs12 -in elastic-stack-ca.p12 -clcerts -nokeys -out newfile.crt.pem
#生成
bin/elasticsearch-certutil cert --pem config/certs/elastic-stack-ca.p12
#方法二
# 为 Kibna 配置 HTTPS
# 生成后解压,包含了instance.crt 和 instance.key
bin/elasticsearch-certutil ca --pem
#Kibana 连接 ES https
# 为kibana生成pem
openssl pkcs12 -in elastic-stack-ca.p12 -cacerts -nokeys -out elastic-ca.pem
3. kibana-配置ssl开启https
#修改kibana.yml
elasticsearch.hosts: ["https://localhost:9200"]
elasticsearch.ssl.certificateAuthorities: [ "/Users/soft/kibana-7.1.0/config/certs/elastic-ca.pem" ]
elasticsearch.ssl.verificationMode: certificate
server.ssl.enabled: true
server.ssl.certificate: config/certs/instance.crt
server.ssl.key: config/certs/instance.key
4. 重启ES和Kibana
文章来源地址https://www.toymoban.com/news/detail-620390.html
文章来源:https://www.toymoban.com/news/detail-620390.html
到了这里,关于Elasticsearch开启HTTPS访问的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!