Add option to skip ssk verification

This commit is contained in:
Blerim Sheqa 2017-01-03 09:34:48 +01:00
parent 54f8172208
commit e981f87635
6 changed files with 14 additions and 1 deletions

View File

@ -71,6 +71,9 @@ Defaults to `icinga`
Instead of stopping on connection loss, Icingabeat will try to reconnect to the Instead of stopping on connection loss, Icingabeat will try to reconnect to the
API periodically. Defaults to `10s` API periodically. Defaults to `10s`
#### `skip_ssl_verify`
Skip verification of SSL certificates. Defaults to `false`
### Eventstream ### Eventstream
These settings are eventsream specific, they apply only to the eventstream. To These settings are eventsream specific, they apply only to the eventstream. To
disable evenstream completely, comment out the whole section. disable evenstream completely, comment out the whole section.

View File

@ -19,6 +19,9 @@ icingabeat:
# Defines how fast to reconnect to the API after a connection loss # Defines how fast to reconnect to the API after a connection loss
retry_interval: 10s retry_interval: 10s
# Skip SSL verification
skip_ssl_verify: false
# Icingabeat supports capturing of an evenstream and periodical polling of the # Icingabeat supports capturing of an evenstream and periodical polling of the
# Icinga status data. # Icinga status data.
# #

View File

@ -11,7 +11,7 @@ import (
func requestURL(bt *Icingabeat, method string, URL *url.URL) (*http.Response, error) { func requestURL(bt *Icingabeat, method string, URL *url.URL) (*http.Response, error) {
transport := &http.Transport{ transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, TLSClientConfig: &tls.Config{InsecureSkipVerify: bt.config.SkipSSLVerify},
} }
client := &http.Client{ client := &http.Client{

View File

@ -12,6 +12,7 @@ type Config struct {
User string `config:"user"` User string `config:"user"`
Password string `config:"password"` Password string `config:"password"`
RetryInterval time.Duration `config:"retry_interval"` RetryInterval time.Duration `config:"retry_interval"`
SkipSSLVerify bool `config:"skip_ssl_verify"`
Eventstream EventstreamConfig `config:"eventstream"` Eventstream EventstreamConfig `config:"eventstream"`
} }

View File

@ -19,6 +19,9 @@ icingabeat:
# Defines how fast to reconnect to the API after a connection loss # Defines how fast to reconnect to the API after a connection loss
retry_interval: 10s retry_interval: 10s
# Skip SSL verification
skip_ssl_verify: false
# Icingabeat supports capturing of an evenstream and periodical polling of the # Icingabeat supports capturing of an evenstream and periodical polling of the
# Icinga status data. # Icinga status data.
# #

View File

@ -19,6 +19,9 @@ icingabeat:
# Defines how fast to reconnect to the API after a connection loss # Defines how fast to reconnect to the API after a connection loss
retry_interval: 10s retry_interval: 10s
# Skip SSL verification
skip_ssl_verify: false
# Icingabeat supports capturing of an evenstream and periodical polling of the # Icingabeat supports capturing of an evenstream and periodical polling of the
# Icinga status data. # Icinga status data.
# #