using http.Client instead of urlfetch.Client

53 views
Skip to first unread message

David Komer

unread,
May 24, 2017, 11:48:05 AM5/24/17
to google-appengine-go
Is that okay for sending out requests?

Specifically, using a custom client from urlfetch does not allow changing the TLSClientConfig which I need to do for sending requests to Stripe.

In other words, I have this code in order to speak with Stripe (adapted from https://stackoverflow.com/a/39059763):

tr := &http.Transport{
    TLSClientConfig:    &tls.Config{MinVersion: tls.VersionTLS12},
    DisableCompression: true,
}
httpClient := &http.Client{Transport: tr}

sc = client.New(STRIPE_SECRET, stripe.NewBackends(httpClient))


EDIT - leaving the above as-is... but it seems like this breaks on production deployment even though it works on local dev server... what's the workaround for production?

David Komer

unread,
May 25, 2017, 5:28:23 AM5/25/17
to google-appengine-go
Nevermind - on production urlfetch.Client() is totally fine... just needed to workaround for dev server, and as long as that works - who cares :P
Reply all
Reply to author
Forward
0 new messages