配置self-signed证书
参考之前的文章
创建self-signed证书
下面展示一些 内联代码片
。
# 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和权限
sudo chown -R elasticsearch:elasticsearch /etc/elasticsearch/certs/
sudo chmod -R 777 etc/elasticsearch/certs/
重启elasticsearch
查看https接口:
文章来源:https://www.toymoban.com/news/detail-513676.html
在springboot项目中连接elasticsearch https
引入rootCA.crt到jdk的cacerts(windows和linux都是一样)
keytool -import -alias yourAliasName -file /etc/elasticsearch/certs/rootCA.crt -keystore jdk_home/lib/security/cacerts
启动springboot项目应该可以连接上elasticsearch了。文章来源地址https://www.toymoban.com/news/detail-513676.html
到了这里,关于配置https ssl elasticsearch,springboot项目中连接elasticsearch https的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!