Skip to content

Commit

Permalink
fix http3 tls ConnectionState
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jul 28, 2023
1 parent e2cff66 commit 7c46314
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/http3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"io"
"net"
"net/http"
"reflect"
"strconv"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -462,15 +461,12 @@ func (c *client) doRequest(req *http.Request, conn quic.EarlyConnection, str qui
return nil, newConnError(errorGeneralProtocolError, err)
}

connState, ok := reflect.ValueOf(conn.ConnectionState().TLS).Field(0).Interface().(tls.ConnectionState)
if !ok {
panic(fmt.Sprintf("bad tls connection state type: %s", reflect.ValueOf(conn.ConnectionState().TLS).Field(0).Type().Name()))
}
res, err := responseFromHeaders(hfs)
if err != nil {
return nil, newStreamError(errorMessageError, err)
}
res.Request = req
connState := conn.ConnectionState().TLS
res.TLS = &connState
respBody := newResponseBody(hstr, conn, reqDone)

Expand Down

0 comments on commit 7c46314

Please sign in to comment.