From 4901e89da79a1d4f2d0d53e762de98c66428f21d Mon Sep 17 00:00:00 2001 From: Burcu Dogan Date: Mon, 14 Jul 2014 10:04:48 -0700 Subject: [PATCH] App Engine Managed VMs should depend on url fetcher. --- google/appenginevm.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/google/appenginevm.go b/google/appenginevm.go index 96c65fe..20711b9 100644 --- a/google/appenginevm.go +++ b/google/appenginevm.go @@ -3,11 +3,12 @@ package google import ( - "net/http" "strings" "github.com/golang/oauth2" + "google.golang.org/appengine" + "google.golang.org/appengine/urlfetch" ) // AppEngineConfig represents a configuration for an @@ -26,7 +27,12 @@ func NewAppEngineConfig(context appengine.Context, scopes []string) *AppEngineCo // NewTransport returns a transport that authorizes // the requests with the application's service account. func (c *AppEngineConfig) NewTransport() oauth2.Transport { - return oauth2.NewAuthorizedTransport(http.DefaultTransport, c, nil) + transport := &urlfetch.Transport{ + Context: c.context, + Deadline: 0, + AllowInvalidServerCertificate: false, + } + return oauth2.NewAuthorizedTransport(transport, c, nil) } // FetchToken fetches a new access token for the provided scopes.