mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-12 16:44:05 -08:00
Support overriding minimum TLS version
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
This commit is contained in:
parent
a11e73edda
commit
09da88114d
|
@ -14,6 +14,7 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/tls"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -179,6 +180,9 @@ var expectedConf = &Config{
|
||||||
},
|
},
|
||||||
FollowRedirects: true,
|
FollowRedirects: true,
|
||||||
EnableHTTP2: true,
|
EnableHTTP2: true,
|
||||||
|
TLSConfig: config.TLSConfig{
|
||||||
|
MinVersion: config.TLSVersion(tls.VersionTLS10),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
ServiceDiscoveryConfigs: discovery.Configs{
|
ServiceDiscoveryConfigs: discovery.Configs{
|
||||||
|
|
3
config/testdata/conf.good.yml
vendored
3
config/testdata/conf.good.yml
vendored
|
@ -91,6 +91,9 @@ scrape_configs:
|
||||||
authorization:
|
authorization:
|
||||||
credentials_file: valid_token_file
|
credentials_file: valid_token_file
|
||||||
|
|
||||||
|
tls_config:
|
||||||
|
min_version: TLS10
|
||||||
|
|
||||||
- job_name: service-x
|
- job_name: service-x
|
||||||
|
|
||||||
basic_auth:
|
basic_auth:
|
||||||
|
|
|
@ -369,6 +369,12 @@ A `tls_config` allows configuring TLS connections.
|
||||||
|
|
||||||
# Disable validation of the server certificate.
|
# Disable validation of the server certificate.
|
||||||
[ insecure_skip_verify: <boolean> ]
|
[ insecure_skip_verify: <boolean> ]
|
||||||
|
|
||||||
|
# Minimum acceptable TLS version. Accepted values: TLS10 (TLS 1.0), TLS11 (TLS
|
||||||
|
# 1.1), TLS12 (TLS 1.2), TLS13 (TLS 1.3).
|
||||||
|
# If unset, Prometheus will use Go default minimum version, which is TLS 1.2.
|
||||||
|
# See MinVersion in https://pkg.go.dev/crypto/tls#Config.
|
||||||
|
[ min_version: <string> ]
|
||||||
```
|
```
|
||||||
|
|
||||||
### `<oauth2>`
|
### `<oauth2>`
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -48,7 +48,7 @@ require (
|
||||||
github.com/prometheus/alertmanager v0.24.0
|
github.com/prometheus/alertmanager v0.24.0
|
||||||
github.com/prometheus/client_golang v1.12.1
|
github.com/prometheus/client_golang v1.12.1
|
||||||
github.com/prometheus/client_model v0.2.0
|
github.com/prometheus/client_model v0.2.0
|
||||||
github.com/prometheus/common v0.33.0
|
github.com/prometheus/common v0.34.0
|
||||||
github.com/prometheus/common/assets v0.1.0
|
github.com/prometheus/common/assets v0.1.0
|
||||||
github.com/prometheus/common/sigv4 v0.1.0
|
github.com/prometheus/common/sigv4 v0.1.0
|
||||||
github.com/prometheus/exporter-toolkit v0.7.1
|
github.com/prometheus/exporter-toolkit v0.7.1
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -1063,8 +1063,8 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9
|
||||||
github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
||||||
github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
||||||
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
||||||
github.com/prometheus/common v0.33.0 h1:rHgav/0a6+uYgGdNt3jwz8FNSesO/Hsang3O0T9A5SE=
|
github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE=
|
||||||
github.com/prometheus/common v0.33.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE=
|
github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE=
|
||||||
github.com/prometheus/common/assets v0.1.0 h1:8WlWPDRjbfff4FWCBjaUF0NEIgDD2Mv2anoKfwG+Ums=
|
github.com/prometheus/common/assets v0.1.0 h1:8WlWPDRjbfff4FWCBjaUF0NEIgDD2Mv2anoKfwG+Ums=
|
||||||
github.com/prometheus/common/assets v0.1.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
|
github.com/prometheus/common/assets v0.1.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
|
||||||
github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4=
|
github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4=
|
||||||
|
|
Loading…
Reference in a new issue