Closed pezhore closed 3 years ago
I have the same issue and found a way to pass custom http.client
:
// ignore expired / self signed SSL certificates
httpClient := &http.Client{
Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}},
}
transport := httptransport.NewWithClient(os.Getenv("NETBOX_HOST"), client.DefaultBasePath, []string{"https"}, httpClient)
transport.DefaultAuthentication = httptransport.APIKeyAuth("Authorization", "header", "Token " + os.Getenv("NETBOX_API_KEY"))
c := client.New(transport, nil)
req := dcim.NewDcimSitesListParams()
res, err := c.Dcim.DcimSitesList(req, nil)
if err != nil {
log.Fatalf("Cannot get sites list: %v", err)
}
log.Infof("res: %v", res)
On my MacBook Pro, when running the example custom host go code, I get an error apparently due to certificate trust issues.
Is there a way to ignore ssl verification?