coopernurse / barrister-go

Barrister RPC bindings for the Go language
http://barrister.bitmechanic.com/
8 stars 4 forks source link

Add way to set custom Transport on http.Client #1

Open bitcartel opened 10 years ago

bitcartel commented 10 years ago

Clients often need to connect to servers who may be using self-signed certificates. Currently Barrister uses the default http.Client which means connecting to these servers will fail. It would be useful to be able to pass in a custom Transport.

Here is how I have fudged things for now in barrister.go:

func (t *HttpTransport) Send(in []byte) ([]byte, error) {
...
tr := &http.Transport{
  TLSClientConfig: &tls.Config{InsecureSkipVerify : true},
}

client := &http.Client{ Transport: tr  }
colega commented 6 years ago

Solved by https://github.com/coopernurse/barrister-go/pull/7