Skip to content

Commit

Permalink
Changed *tls.Conn by extended connTLSer
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrr authored and erikdubbelboer committed Nov 12, 2018
1 parent d37102d commit 3fb1313
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ func (ctx *RequestCtx) VisitUserValues(visitor func([]byte, interface{})) {
}

type connTLSer interface {
Handshake() error
ConnectionState() tls.ConnectionState
}

Expand Down Expand Up @@ -1268,7 +1269,7 @@ func (s *Server) NextProto(key string, nph ServeHandler) {
}

func (s *Server) hasNextProto(c net.Conn) (proto string, err error) {
tlsConn, ok := c.(*tls.Conn)
tlsConn, ok := c.(connTLSer)
if ok {
err = tlsConn.Handshake()
proto = tlsConn.ConnectionState().NegotiatedProtocol
Expand Down

0 comments on commit 3fb1313

Please sign in to comment.