Blame


1 2c4d16ae 2021-12-23 o Icinga2 servers in the wild often serve self-signed certificates which
2 2c4d16ae 2021-12-23 o fail verification by Go's tls client. To ignore the errors, Dial the server
3 2c4d16ae 2021-12-23 o with a modified http.Client:
4 2c4d16ae 2021-12-23 o
5 9ab732cd 2021-12-30 o t := http.DefaultTransport.(*http.Transport)
6 9ab732cd 2021-12-30 o t.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
7 9ab732cd 2021-12-30 o c := http.DefaultClient
8 9ab732cd 2021-12-30 o c.Transport = t
9 2c4d16ae 2021-12-23 o client, err := icinga.Dial(host, user, pass, c)
10 2c4d16ae 2021-12-23 o if err != nil {
11 2c4d16ae 2021-12-23 o // handle error
12 2c4d16ae 2021-12-23 o }
13 2c4d16ae 2021-12-23 o ...
14 2c4d16ae 2021-12-23 o
15 2c4d16ae 2021-12-23 o ## Why?
16 2c4d16ae 2021-12-23 o
17 2c4d16ae 2021-12-23 o The terraform provider...