File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ func (clientBuilder *ClientBuilder) WithNetworkRetryCount(count int) *ClientBuil
6565 return clientBuilder
6666}
6767
68+ func (clientBuilder * ClientBuilder ) WithIgnoreServerCertificate (ignoreServerCert bool ) * ClientBuilder {
69+ clientBuilder .connectionInfo .IgnoreServerCertificate = ignoreServerCert
70+ return clientBuilder
71+ }
72+
6873func (clientBuilder * ClientBuilder ) WithLogger (logger sdk_log.Logger ) * ClientBuilder {
6974 clientBuilder .logger = logger
7075 return clientBuilder
Original file line number Diff line number Diff line change 11package networking
22
33import (
4+ "crypto/tls"
45 "net/http"
56 "net/url"
67 "github.com/SpectraLogic/ds3_go_sdk/ds3/models"
78)
89
910type ConnectionInfo struct {
10- Endpoint * url.URL
11- Credentials * Credentials
12- Proxy * url.URL
11+ Endpoint * url.URL
12+ Credentials * Credentials
13+ Proxy * url.URL
14+ IgnoreServerCertificate bool
1315}
1416
1517type Credentials struct {
@@ -27,9 +29,15 @@ type SendNetwork struct {
2729}
2830
2931func NewSendNetwork (connectionInfo * ConnectionInfo ) Network {
30- return & SendNetwork {
31- transport : & http.Transport {Proxy : http .ProxyURL (connectionInfo .Proxy )},
32+ sendNetwork := & SendNetwork {
33+ transport : & http.Transport {
34+ Proxy : http .ProxyURL (connectionInfo .Proxy ),
35+ },
3236 }
37+ if connectionInfo .IgnoreServerCertificate {
38+ sendNetwork .transport .TLSClientConfig = & tls.Config {InsecureSkipVerify : true }
39+ }
40+ return sendNetwork
3341}
3442
3543func (sendNetwork * SendNetwork ) Invoke (httpRequest * http.Request ) (models.WebResponse , error ) {
You can’t perform that action at this time.
0 commit comments