use cleanhttp to get a default transport.

This commit is contained in:
Matthew Hooker 2017-05-24 11:05:59 -07:00
parent 4fc0616bc9
commit f6eb4e1b40
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 4 additions and 3 deletions

View File

@ -3,14 +3,15 @@ package openstack
import (
"crypto/tls"
"fmt"
"net/http"
"os"
"crypto/x509"
"io/ioutil"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack"
"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/packer/template/interpolate"
"io/ioutil"
)
// AccessConfig is for common configuration related to openstack access
@ -126,7 +127,7 @@ func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error {
tls_config.Certificates = []tls.Certificate{cert}
}
transport := http.DefaultTransport.(*http.Transport)
transport := cleanhttp.DefaultTransport()
transport.TLSClientConfig = tls_config
client.HTTPClient.Transport = transport