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:
parent
097926c51f
commit
9ffa124511
28 changed files with 291 additions and 244 deletions
|
|
@ -122,7 +122,7 @@ func ParseUDPAddr(address string) (*net.UDPAddr, error) {
|
|||
//
|
||||
// 2. if tlsConfig.NextProtos is empty _and_ the port is 443 or 8853,
|
||||
// then we configure, respectively, "h3" and "dq".
|
||||
func (d *quicDialerQUICGo) DialContext(ctx context.Context, network string,
|
||||
func (d *quicDialerQUICGo) DialContext(ctx context.Context,
|
||||
address string, tlsConfig *tls.Config, quicConfig *quic.Config) (
|
||||
quic.EarlyConnection, error) {
|
||||
udpAddr, err := ParseUDPAddr(address)
|
||||
|
|
@ -194,9 +194,9 @@ var _ model.QUICDialer = &quicDialerHandshakeCompleter{}
|
|||
|
||||
// DialContext implements model.QUICDialer.DialContext.
|
||||
func (d *quicDialerHandshakeCompleter) DialContext(
|
||||
ctx context.Context, network, address string,
|
||||
ctx context.Context, address string,
|
||||
tlsConfig *tls.Config, quicConfig *quic.Config) (quic.EarlyConnection, error) {
|
||||
conn, err := d.Dialer.DialContext(ctx, network, address, tlsConfig, quicConfig)
|
||||
conn, err := d.Dialer.DialContext(ctx, address, tlsConfig, quicConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ var _ model.QUICDialer = &quicDialerResolver{}
|
|||
// 1. if tlsConfig.ServerName is empty, we will use the hostname
|
||||
// contained inside of the `address` endpoint.
|
||||
func (d *quicDialerResolver) DialContext(
|
||||
ctx context.Context, network, address string,
|
||||
ctx context.Context, address string,
|
||||
tlsConfig *tls.Config, quicConfig *quic.Config) (quic.EarlyConnection, error) {
|
||||
onlyhost, onlyport, err := net.SplitHostPort(address)
|
||||
if err != nil {
|
||||
|
|
@ -272,7 +272,7 @@ func (d *quicDialerResolver) DialContext(
|
|||
for _, addr := range addrs {
|
||||
target := net.JoinHostPort(addr, onlyport)
|
||||
qconn, err := d.Dialer.DialContext(
|
||||
ctx, network, target, tlsConfig, quicConfig)
|
||||
ctx, target, tlsConfig, quicConfig)
|
||||
if err == nil {
|
||||
return qconn, nil
|
||||
}
|
||||
|
|
@ -325,16 +325,16 @@ var _ model.QUICDialer = &quicDialerLogger{}
|
|||
|
||||
// DialContext implements QUICContextDialer.DialContext.
|
||||
func (d *quicDialerLogger) DialContext(
|
||||
ctx context.Context, network, address string,
|
||||
ctx context.Context, address string,
|
||||
tlsConfig *tls.Config, quicConfig *quic.Config) (quic.EarlyConnection, error) {
|
||||
d.Logger.Debugf("quic_dial%s %s/%s...", d.operationSuffix, address, network)
|
||||
qconn, err := d.Dialer.DialContext(ctx, network, address, tlsConfig, quicConfig)
|
||||
d.Logger.Debugf("quic_dial%s %s/udp...", d.operationSuffix, address)
|
||||
qconn, err := d.Dialer.DialContext(ctx, address, tlsConfig, quicConfig)
|
||||
if err != nil {
|
||||
d.Logger.Debugf("quic_dial%s %s/%s... %s", d.operationSuffix,
|
||||
address, network, err)
|
||||
d.Logger.Debugf("quic_dial%s %s/udp... %s", d.operationSuffix,
|
||||
address, err)
|
||||
return nil, err
|
||||
}
|
||||
d.Logger.Debugf("quic_dial%s %s/%s... ok", d.operationSuffix, address, network)
|
||||
d.Logger.Debugf("quic_dial%s %s/udp... ok", d.operationSuffix, address)
|
||||
return qconn, nil
|
||||
}
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ var _ model.QUICDialer = &quicDialerSingleUse{}
|
|||
|
||||
// DialContext implements QUICDialer.DialContext.
|
||||
func (s *quicDialerSingleUse) DialContext(
|
||||
ctx context.Context, network, addr string, tlsCfg *tls.Config,
|
||||
ctx context.Context, addr string, tlsCfg *tls.Config,
|
||||
cfg *quic.Config) (quic.EarlyConnection, error) {
|
||||
var qconn quic.EarlyConnection
|
||||
defer s.mu.Unlock()
|
||||
|
|
@ -436,9 +436,9 @@ var _ model.QUICDialer = &quicDialerErrWrapper{}
|
|||
|
||||
// DialContext implements ContextDialer.DialContext
|
||||
func (d *quicDialerErrWrapper) DialContext(
|
||||
ctx context.Context, network string, host string,
|
||||
ctx context.Context, host string,
|
||||
tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlyConnection, error) {
|
||||
qconn, err := d.QUICDialer.DialContext(ctx, network, host, tlsCfg, cfg)
|
||||
qconn, err := d.QUICDialer.DialContext(ctx, host, tlsCfg, cfg)
|
||||
if err != nil {
|
||||
return nil, NewErrWrapper(
|
||||
ClassifyQUICHandshakeError, QUICHandshakeOperation, err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue