File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11module github.com/pavel-z1/phpipam-sdk-go
2+
3+ require github.com/imdario/mergo v0.0.0-20160517064435-50d4dbd4eb0e
4+
5+ go 1.13
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ type Config struct {
4444
4545 // The user name for the PHPIPAM account.
4646 Username string
47+
48+ // Allow HTTPS connection without verification issuer
49+ Insecure bool
4750}
4851
4952// DefaultConfigProvider supplies a default configuration:
Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ package request
33
44import (
55 "bytes"
6+ "crypto/tls"
67 "encoding/json"
78 "fmt"
89 "io/ioutil"
9- "net/http"
1010 "log"
11+ "net/http"
1112
1213 "github.com/pavel-z1/phpipam-sdk-go/phpipam/session"
1314)
@@ -131,7 +132,11 @@ func newRequestResponse(r *http.Response) *requestResponse {
131132func (r * Request ) Send () error {
132133 var req * http.Request
133134 var err error
135+ tr := & http.Transport {
136+ TLSClientConfig : & tls.Config {InsecureSkipVerify : r .Session .Config .Insecure },
137+ }
134138 client := & http.Client {
139+ Transport : tr ,
135140 CheckRedirect : func (req * http.Request , via []* http.Request ) error {
136141 return http .ErrUseLastResponse
137142 },
You can’t perform that action at this time.
0 commit comments