use tlsClientConfig instead of custom dialer

This commit is contained in:
Denis Mishin 2022-12-23 22:10:02 -05:00
parent 753eeff12f
commit bfadf123d5
6 changed files with 52 additions and 7 deletions

View file

@ -3,6 +3,7 @@ package proxy
import (
"context"
"crypto/cipher"
"net/http"
"net/url"
"github.com/pomerium/pomerium/config"
@ -61,9 +62,13 @@ func newProxyStateFromConfig(cfg *config.Config) (*proxyState, error) {
if err != nil {
return nil, err
}
tlsConfig, err := cfg.GetTLSClientConfig()
if err != nil {
return nil, err
}
state.authenticateKeyFetcher = hpke.NewKeyFetcher(authenticateURL.ResolveReference(&url.URL{
Path: "/.well-known/pomerium/jwks.json",
}).String())
}).String(), &http.Transport{TLSClientConfig: tlsConfig, ForceAttemptHTTP2: true})
state.sharedCipher, err = cryptutil.NewAEADCipher(state.sharedKey)
if err != nil {