chore: upgrade deps and attempt to enable using go1.19 (#869)

* upgrade to our go.mod enabled of psiphon-tunnel-core such that
we're now using v2.0.24 of the tunnel-core;

* upgrade to the latest lucas-clemente/quic-go release;

* upgrade to the latest ooni/oohttp release (which is based on go1.19
but the diff seems good enough to continue using go1.18.x as well);

* upgrade to the latest ooni/oocrypto release (for which we can make the
same remarks regarding using go1.18.x);

* deal with changes in lucas-clemente/quic-go API as well as changes
in what a go1.19 *tls.Conn compatible type should look like.

Unfortunately, we cannot switch to go1.19 because psiphon forks quic-go
and their fork's still not building using such a version of go.

Part of ooni/probe#2211.
This commit is contained in:
Simone Basso 2022-08-19 11:26:50 +02:00 committed by GitHub
commit 9ffa124511
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 291 additions and 244 deletions

View file

@ -36,8 +36,14 @@ func NewTLSHandshakerUTLS(logger model.DebugLogger, id *utls.ClientHelloID) mode
// utlsConn implements TLSConn and uses a utls UConn as its underlying connection
type utlsConn struct {
// We include the real UConn
*utls.UConn
// This field helps with writing tests
testableHandshake func() error
// Required by NetConn
nc net.Conn
}
// Ensures that a utlsConn implements the TLSConn interface.
@ -85,7 +91,12 @@ func newConnUTLSWithHelloID(conn net.Conn, config *tls.Config, cid *utls.ClientH
ServerName: config.ServerName,
}
tlsConn := utls.UClient(conn, uConfig, *cid)
return &utlsConn{UConn: tlsConn}, nil
oconn := &utlsConn{
UConn: tlsConn,
testableHandshake: nil,
nc: conn,
}
return oconn, nil
}
// ErrUTLSHandshakePanic indicates that there was panic handshaking
@ -136,3 +147,7 @@ func (c *utlsConn) ConnectionState() tls.ConnectionState {
TLSUnique: uState.TLSUnique,
}
}
func (c *utlsConn) NetConn() net.Conn {
return c.nc
}