mirror of
https://github.com/docker/cli.git
synced 2026-11-06 13:10:41 -04:00
vendor: github.com/docker/go-connections v0.8.2
v0.8.2 - sockets: preserve configured TLS ALPN protocols - ci: add dependabot to update actions - ci: update runners to Ubuntu 26.04 - build(deps): bump actions/checkout from 6.0.2 to 7.0.1 - build(deps): bump actions/setup-go from 6.3.0 to 7.0.0 - build(deps): bump golangci/golangci-lint-action from 9.2.0 to 9.3.0 full diff: https://github.com/docker/go-connections/compare/v0.8.1...v0.8.2 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
+5
-1
@@ -9,13 +9,17 @@ import (
|
||||
// NewTCPSocket creates a TCP socket listener with the specified address and
|
||||
// the specified tls configuration. If TLSConfig is set, will encapsulate the
|
||||
// TCP listener inside a TLS one.
|
||||
// If no ALPN protocols are configured, it defaults to HTTP/1.1.
|
||||
func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) {
|
||||
l, err := net.Listen("tcp", addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tlsConfig != nil {
|
||||
tlsConfig.NextProtos = []string{"http/1.1"}
|
||||
if len(tlsConfig.NextProtos) == 0 {
|
||||
tlsConfig = tlsConfig.Clone()
|
||||
tlsConfig.NextProtos = []string{"http/1.1"}
|
||||
}
|
||||
l = tls.NewListener(l, tlsConfig)
|
||||
}
|
||||
return l, nil
|
||||
|
||||
Reference in New Issue
Block a user