mirror of
https://github.com/rancher/dynamiclistener.git
synced 2025-05-30 10:34:21 +00:00
Without this change, if a cert is updated (e.g. to add CNs) while the listener is in the middle of Accept()ing a new connection, the connection gets dropped, we'll see a message like this in the server logs: http: TLS handshake error from 127.0.0.1:51232: write tcp 127.0.7.1:8443->127.0.0.1:51232: use of closed network connection and the client (like a browser) won't necessarily reconnect. This change modifies the GetCertificate routine in the listener's tls.Config to keep track of the state of the incoming connections and only close connections that have completed GetCertificate and therefore are finished with their TLS handshake, so that only old established connections are closed. |
||
---|---|---|
cert | ||
factory | ||
server | ||
storage | ||
filter.go | ||
go.mod | ||
go.sum | ||
LICENSE | ||
listener.go | ||
redirect.go | ||
tcp.go |