docker / go-connections

Utility package to work with network connections
https://pkg.go.dev/github.com/docker/go-connections
Apache License 2.0
217 stars 101 forks source link

Overriding NextProtos can interfere with Application-Layer Protocol Negotiation or ALPN #95

Open jmacelroy opened 3 years ago

jmacelroy commented 3 years ago

If a server, such as grpc, is trying to set an app protocol and uses this lib for the socket then it will be overridden by https://github.com/docker/go-connections/blob/58542c764a1173ea3dac965d89146c931a2946f7/sockets/tcp_socket.go#L18.

This was probably unnoticed until go 1.17 when enforcement became strict https://golang.org/doc/go1.17#ALPN