feat: introduce TLSConn abstraction and use it consistently#4
Merged
bassosimone merged 1 commit intomainfrom Aug 12, 2021
Merged
feat: introduce TLSConn abstraction and use it consistently#4bassosimone merged 1 commit intomainfrom
bassosimone merged 1 commit intomainfrom
Conversation
With this abstraction in place, it's quite easy to use
github.com/refraction-networkings/utls with this net/http fork.
```
> git grep 'tls\.Conn'
cgi/child.go: r.TLS = &tls.ConnectionState{HandshakeComplete: true}
h2_bundle.go: ConnectionState() tls.ConnectionState
h2_bundle.go:// client. If c has a ConnectionState method like a *tls.Conn, the
h2_bundle.go: sc.tlsState = new(tls.ConnectionState)
h2_bundle.go: tlsState *tls.ConnectionState // shared by all handlers, like net/http
h2_bundle.go: // TODO: add CloseWrite to crypto/tls.Conn first
h2_bundle.go: var tlsState *tls.ConnectionState // nil if not scheme https
h2_bundle.go: // If the returned net.Conn has a ConnectionState method like tls.Conn,
h2_bundle.go: tlsState *tls.ConnectionState // nil only for specialized impls
httptest/httptest.go: req.TLS = &tls.ConnectionState{
httptest/httptest_test.go: TLS: &tls.ConnectionState{
httptrace/trace.go: TLSHandshakeDone func(tls.ConnectionState, error)
request.go: TLS *tls.ConnectionState
response.go: TLS *tls.ConnectionState
server.go: tlsState *tls.ConnectionState
server.go: c.tlsState = new(tls.ConnectionState)
server.go: req.TLS = &tls.ConnectionState{}
tlsconn.go:// TLSConn is the interface representing a *tls.Conn compatible
tlsconn.go:// connection, which could possibly be different from a *tls.Conn
tlsconn.go: ConnectionState() tls.ConnectionState
transport.go: trace.TLSHandshakeDone(tls.ConnectionState{}, err)
transport.go: trace.TLSHandshakeDone(tls.ConnectionState{}, err)
transport.go: tlsState *tls.ConnectionState
transport_test.go: TLSHandshakeDone: func(s tls.ConnectionState, err error) {
transport_test.go: TLSHandshakeDone: func(s tls.ConnectionState, err error) {
transport_test.go: TLSHandshakeDone: func(cfg tls.ConnectionState, err error) {
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this abstraction in place, it's quite easy to use
github.com/refraction-networkings/utls with this net/http fork.