mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-06-13 15:47:38 +08:00
refactor: improve TLS config handling and add bridge connection tests
This commit is contained in:
parent
dcdb1504a3
commit
d53693952a
3 changed files with 153 additions and 7 deletions
|
|
@ -51,9 +51,10 @@ func newHTTP1BridgeTransportWithTLSConfig(tlsConfig *tls.Config) http.RoundTripp
|
|||
transport := cloneDefaultTransport()
|
||||
transport.Protocols = new(http.Protocols)
|
||||
transport.Protocols.SetHTTP1(true)
|
||||
transport.TLSClientConfig = tlsConfig
|
||||
if transport.TLSClientConfig == nil {
|
||||
if tlsConfig == nil {
|
||||
transport.TLSClientConfig = &tls.Config{}
|
||||
} else {
|
||||
transport.TLSClientConfig = tlsConfig.Clone()
|
||||
}
|
||||
if len(transport.TLSClientConfig.NextProtos) == 0 {
|
||||
transport.TLSClientConfig.NextProtos = []string{"http/1.1"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue