request: Add Conn and TLS methods

This commit is contained in:
Adnan Maolood
2021-02-23 17:27:54 -05:00
parent 83c904913f
commit c688defefd
2 changed files with 17 additions and 27 deletions

View File

@@ -366,16 +366,7 @@ func (srv *Server) serveConn(ctx context.Context, conn net.Conn) error {
w.WriteHeader(StatusBadRequest, "Bad request")
return w.Flush()
}
// Store the TLS connection state
if tlsConn, ok := conn.(*tls.Conn); ok {
state := tlsConn.ConnectionState()
req.TLS = &state
req.Host = state.ServerName
}
// Store remote address
req.RemoteAddr = conn.RemoteAddr()
req.conn = conn
h := srv.Handler
if h == nil {