安装elasticsearch的docker版本,需要设置ssl,但是没有证书,能生成一个自签的证书,然后搭配到elasticsearch,生成相关ssl设置的教程
要在Elasticsearch Docker安装中使用自签名SSL证书,你可以按照以下步骤操作:
步骤 1: 安装 OpenSSL
确保你的系统上安装了OpenSSL。在大多数Linux发行版和MacOS上,OpenSSL通常已经预安装了。如果没有,你可以通过包管理器安装它。
步骤 2: 生成自签名证书
创建证书密钥:
openssl genrsa -out rootCA.key 4096
创建根证书(CA),内容随便填:
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
创建服务器证书的密钥:
openssl genrsa -out elasticsearch.key 4096
创建证书签名请求(CSR),内容随便填:
openssl req -new -key elasticsearch.key -out elasticsearch.csr
创建配置文件以指定证书选项:
创建一个文件 v3.ext ,以包含需要的DNS和IP地址,注意ip地址一定要设置准确,不然后面无法使用,例如:
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSigna