mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-04 20:03:18 +02:00
use tlsClientConfig instead of custom dialer (#3830)
* use tlsClientConfig instead of custom dialer * rm debug log
This commit is contained in:
parent
5252cbda23
commit
a49f86d023
6 changed files with 49 additions and 7 deletions
|
@ -117,3 +117,15 @@ func NewPolicyHTTPTransport(options *Options, policy *Policy, disableHTTP2 bool)
|
|||
}
|
||||
return c.Then(transport)
|
||||
}
|
||||
|
||||
// GetTLSClientTransport returns http transport accounting for custom CAs from config
|
||||
func GetTLSClientTransport(cfg *Config) (*http.Transport, error) {
|
||||
tlsConfig, err := cfg.GetTLSClientConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &http.Transport{
|
||||
TLSClientConfig: tlsConfig,
|
||||
ForceAttemptHTTP2: true,
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue