Merge pull request #557 from stuart-c/insecure_skip_verify
Add global InsecureSkipVerify option to disable certificate checking
This commit is contained in:
commit
5ce9719951
4 changed files with 19 additions and 0 deletions
|
@ -33,6 +33,7 @@ type GlobalConfiguration struct {
|
||||||
DefaultEntryPoints DefaultEntryPoints `description:"Entrypoints to be used by frontends that do not specify any entrypoint"`
|
DefaultEntryPoints DefaultEntryPoints `description:"Entrypoints to be used by frontends that do not specify any entrypoint"`
|
||||||
ProvidersThrottleDuration time.Duration `description:"Backends throttle duration: minimum duration between 2 events from providers before applying a new configuration. It avoids unnecessary reloads if multiples events are sent in a short amount of time."`
|
ProvidersThrottleDuration time.Duration `description:"Backends throttle duration: minimum duration between 2 events from providers before applying a new configuration. It avoids unnecessary reloads if multiples events are sent in a short amount of time."`
|
||||||
MaxIdleConnsPerHost int `description:"If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used"`
|
MaxIdleConnsPerHost int `description:"If non-zero, controls the maximum idle (keep-alive) to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used"`
|
||||||
|
InsecureSkipVerify bool `description:"Disable SSL certificate verification"`
|
||||||
Retry *Retry `description:"Enable retry sending request if network error"`
|
Retry *Retry `description:"Enable retry sending request if network error"`
|
||||||
Docker *provider.Docker `description:"Enable Docker backend"`
|
Docker *provider.Docker `description:"Enable Docker backend"`
|
||||||
File *provider.File `description:"Enable File backend"`
|
File *provider.File `description:"Enable File backend"`
|
||||||
|
|
|
@ -46,6 +46,13 @@
|
||||||
#
|
#
|
||||||
# MaxIdleConnsPerHost = 200
|
# MaxIdleConnsPerHost = 200
|
||||||
|
|
||||||
|
# If set to true invalid SSL certificates are accepted for backends.
|
||||||
|
# Note: This disables detection of man-in-the-middle attacks so should only be used on secure backend networks.
|
||||||
|
# Optional
|
||||||
|
# Default: false
|
||||||
|
#
|
||||||
|
# InsecureSkipVerify = true
|
||||||
|
|
||||||
# Entrypoints to be used by frontends that do not specify any entrypoint.
|
# Entrypoints to be used by frontends that do not specify any entrypoint.
|
||||||
# Each frontend can specify its own entrypoints.
|
# Each frontend can specify its own entrypoints.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/tls"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
fmtlog "log"
|
fmtlog "log"
|
||||||
|
@ -173,6 +174,9 @@ func run(traefikConfiguration *TraefikConfiguration) {
|
||||||
globalConfiguration := traefikConfiguration.GlobalConfiguration
|
globalConfiguration := traefikConfiguration.GlobalConfiguration
|
||||||
|
|
||||||
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = globalConfiguration.MaxIdleConnsPerHost
|
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = globalConfiguration.MaxIdleConnsPerHost
|
||||||
|
if globalConfiguration.InsecureSkipVerify {
|
||||||
|
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||||
|
}
|
||||||
loggerMiddleware := middlewares.NewLogger(globalConfiguration.AccessLogsFile)
|
loggerMiddleware := middlewares.NewLogger(globalConfiguration.AccessLogsFile)
|
||||||
defer loggerMiddleware.Close()
|
defer loggerMiddleware.Close()
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,13 @@
|
||||||
#
|
#
|
||||||
# MaxIdleConnsPerHost = 200
|
# MaxIdleConnsPerHost = 200
|
||||||
|
|
||||||
|
# If set to true invalid SSL certificates are accepted for backends.
|
||||||
|
# Note: This disables detection of man-in-the-middle attacks so should only be used on secure backend networks.
|
||||||
|
# Optional
|
||||||
|
# Default: false
|
||||||
|
#
|
||||||
|
# InsecureSkipVerify = true
|
||||||
|
|
||||||
# Entrypoints to be used by frontends that do not specify any entrypoint.
|
# Entrypoints to be used by frontends that do not specify any entrypoint.
|
||||||
# Each frontend can specify its own entrypoints.
|
# Each frontend can specify its own entrypoints.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue