Support proxying images with no provided intermediate cert (#241)

Replace http.DefaultTransport with aia-transport-go to properly handle missing intermediate certs
This commit is contained in:
Blake Stoddard 2020-09-10 04:52:43 -04:00 committed by GitHub
parent 52f4360543
commit fd43ff2198
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -35,6 +35,7 @@ import (
"strings"
"time"
"github.com/fcjr/aia-transport-go"
"github.com/gregjones/httpcache"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
@ -102,7 +103,7 @@ type Proxy struct {
// be used.
func NewProxy(transport http.RoundTripper, cache Cache) *Proxy {
if transport == nil {
transport = http.DefaultTransport
transport, _ = aia.NewTransport()
}
if cache == nil {
cache = NopCache