配置self-signed證書
參考之前的文章
創(chuàng)建self-signed證書
下面展示一些 內(nèi)聯(lián)代碼片
。
# Enable security features
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: true
key: /etc/elasticsearch/certs/server.key
certificate: /etc/elasticsearch/certs/server.crt
certificate_authorities: /etc/elasticsearch/certs/rootCA.crt
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: true
key: /etc/elasticsearch/certs/server.key
certificate: /etc/elasticsearch/certs/server.crt
certificate_authorities: /etc/elasticsearch/certs/rootCA.crt
cluster.initial_master_nodes: ["your_hostname"]
# Allow HTTP API connections from localhost and local networks
# Connections are encrypted and require user authentication
http.host: [_local_, _site_]
path.repo: ["/opt/apps/elasticsearchdata"]
# Allow other nodes to join the cluster from localhost and local networks
# Connections are encrypted and mutually authenticated
#transport.host: [_local_, _site_]
更改user和權(quán)限
sudo chown -R elasticsearch:elasticsearch /etc/elasticsearch/certs/
sudo chmod -R 777 etc/elasticsearch/certs/
重啟elasticsearch
查看https接口:
文章來源:http://www.zghlxwxcb.cn/news/detail-513676.html
在springboot項(xiàng)目中連接elasticsearch https
引入rootCA.crt到j(luò)dk的cacerts(windows和linux都是一樣)
keytool -import -alias yourAliasName -file /etc/elasticsearch/certs/rootCA.crt -keystore jdk_home/lib/security/cacerts
啟動springboot項(xiàng)目應(yīng)該可以連接上elasticsearch了。文章來源地址http://www.zghlxwxcb.cn/news/detail-513676.html
到了這里,關(guān)于配置https ssl elasticsearch,springboot項(xiàng)目中連接elasticsearch https的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!