【发布时间】:2021-09-24 23:26:25
【问题描述】:
尝试为 prometheus 建立 SSL(通过 docker 启动)。我使用 open ssl 自己生成了密钥和 crt。对:key 和 crt 工作正常。 当我在主机上执行此命令时:
openssl s_server -cert prometheus.crt -key prometheus.key
意思是“接受”
这是我用于 prometheus 容器的 Dockerfile:
https://pastebin.com/4wGtCGp6
当我构建映像并启动它时,它说:
level=error ts=2021-09-24T20:44:11.649Z caller=stdlib.go:105 component=web caller="http: 来自 127.0.0.1:50458 的 TLS 握手错误" msg="remote error: tls: bad certificate "
кричит постоянно
在 web.yml 中,我通过以下方式配置 SSL:
tls_server_config:
cert_file: /etc/prometheus/prometheus.crt
key_file: /etc/prometheus/prometheus.key
在 prometheus.yml 中,我通过以下方式配置 SSL:
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
scheme: https
tls_config:
ca_file: /etc/prometheus/prometheus.crt
cert_file: /etc/prometheus/prometheus.crt
key_file: /etc/prometheus/prometheus.key
这个错误的原因可能是什么?
【问题讨论】:
标签: ssl openssl prometheus dock