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:
@@ -40,7 +40,7 @@ func (s *Saver) WrapQUICDialer(qd model.QUICDialer) model.QUICDialer {
|
||||
}
|
||||
|
||||
// DialContext implements QUICDialer.DialContext
|
||||
func (h *QUICDialerSaver) DialContext(ctx context.Context, network string,
|
||||
func (h *QUICDialerSaver) DialContext(ctx context.Context,
|
||||
host string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlyConnection, error) {
|
||||
start := time.Now()
|
||||
// TODO(bassosimone): in the future we probably want to also save
|
||||
@@ -48,12 +48,12 @@ func (h *QUICDialerSaver) DialContext(ctx context.Context, network string,
|
||||
h.Saver.Write(&EventQUICHandshakeStart{&EventValue{
|
||||
Address: host,
|
||||
NoTLSVerify: tlsCfg.InsecureSkipVerify,
|
||||
Proto: network,
|
||||
Proto: "udp",
|
||||
TLSNextProtos: tlsCfg.NextProtos,
|
||||
TLSServerName: tlsCfg.ServerName,
|
||||
Time: start,
|
||||
}})
|
||||
sess, err := h.QUICDialer.DialContext(ctx, network, host, tlsCfg, cfg)
|
||||
sess, err := h.QUICDialer.DialContext(ctx, host, tlsCfg, cfg)
|
||||
stop := time.Now()
|
||||
if err != nil {
|
||||
// TODO(bassosimone): here we should save the peer certs
|
||||
@@ -62,7 +62,7 @@ func (h *QUICDialerSaver) DialContext(ctx context.Context, network string,
|
||||
Duration: stop.Sub(start),
|
||||
Err: NewFailureStr(err),
|
||||
NoTLSVerify: tlsCfg.InsecureSkipVerify,
|
||||
Proto: network,
|
||||
Proto: "udp",
|
||||
TLSNextProtos: tlsCfg.NextProtos,
|
||||
TLSPeerCerts: [][]byte{},
|
||||
TLSServerName: tlsCfg.ServerName,
|
||||
@@ -75,7 +75,7 @@ func (h *QUICDialerSaver) DialContext(ctx context.Context, network string,
|
||||
Address: host,
|
||||
Duration: stop.Sub(start),
|
||||
NoTLSVerify: tlsCfg.InsecureSkipVerify,
|
||||
Proto: network,
|
||||
Proto: "udp",
|
||||
TLSCipherSuite: netxlite.TLSCipherSuiteString(state.CipherSuite),
|
||||
TLSNegotiatedProto: state.NegotiatedProtocol,
|
||||
TLSNextProtos: tlsCfg.NextProtos,
|
||||
|
||||
@@ -91,7 +91,7 @@ func TestQUICDialerSaver(t *testing.T) {
|
||||
},
|
||||
}
|
||||
dialer := saver.WrapQUICDialer(&mocks.QUICDialer{
|
||||
MockDialContext: func(ctx context.Context, network, address string,
|
||||
MockDialContext: func(ctx context.Context, address string,
|
||||
tlsConfig *tls.Config, quicConfig *quic.Config) (quic.EarlyConnection, error) {
|
||||
return returnedConn, nil
|
||||
},
|
||||
@@ -103,7 +103,7 @@ func TestQUICDialerSaver(t *testing.T) {
|
||||
ServerName: "dns.google",
|
||||
}
|
||||
quicConfig := &quic.Config{}
|
||||
conn, err := dialer.DialContext(ctx, "udp", "8.8.8.8:443", tlsConfig, quicConfig)
|
||||
conn, err := dialer.DialContext(ctx, "8.8.8.8:443", tlsConfig, quicConfig)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func TestQUICDialerSaver(t *testing.T) {
|
||||
expected := errors.New("mocked error")
|
||||
saver := &Saver{}
|
||||
dialer := saver.WrapQUICDialer(&mocks.QUICDialer{
|
||||
MockDialContext: func(ctx context.Context, network, address string,
|
||||
MockDialContext: func(ctx context.Context, address string,
|
||||
tlsConfig *tls.Config, quicConfig *quic.Config) (quic.EarlyConnection, error) {
|
||||
return nil, expected
|
||||
},
|
||||
@@ -143,7 +143,7 @@ func TestQUICDialerSaver(t *testing.T) {
|
||||
ServerName: "dns.google",
|
||||
}
|
||||
quicConfig := &quic.Config{}
|
||||
conn, err := dialer.DialContext(ctx, "udp", "8.8.8.8:443", tlsConfig, quicConfig)
|
||||
conn, err := dialer.DialContext(ctx, "8.8.8.8:443", tlsConfig, quicConfig)
|
||||
if !errors.Is(err, expected) {
|
||||
t.Fatal("unexpected err", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user