From 7964916b4c2d5be554cbb64601374b21ed5178f8 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Wed, 7 Aug 2024 13:03:19 -0400 Subject: [PATCH 1/2] Update to latest dtls library. Fixes #85 --- address.go | 25 ++++++++++++++++++++++ dtls/address.go | 8 +++---- dtls/connection.go | 8 +++++-- dtls/dialer.go | 47 +++++++++++++++++++++++++--------------- dtls/listener.go | 39 ++++++++++++++++++++++++++++------ go.mod | 14 ++++++------ go.sum | 53 ++++++++++++---------------------------------- 7 files changed, 119 insertions(+), 75 deletions(-) diff --git a/address.go b/address.go index e6f8e54..987aff1 100644 --- a/address.go +++ b/address.go @@ -31,6 +31,9 @@ const ( KeyProxy = "proxy" KeyProtocol = "protocol" KeyCachedProxyConfiguration = "cachedProxyConfiguration" + + KeyHandshakeTimeout = "handshakeTimeout" + KeyCachedHandshakeTimeout = "cachedHandshakeTimeout" ) type Configuration map[interface{}]interface{} @@ -84,6 +87,28 @@ func (self Configuration) GetProxyConfiguration() (*ProxyConfiguration, error) { return result, nil } +func (self Configuration) GetHandshakeTimeout() (time.Duration, error) { + if val, ok := self[KeyCachedHandshakeTimeout]; ok { + if timeout, ok := val.(time.Duration); ok { + return timeout, nil + } + } + + if val, ok := self[KeyHandshakeTimeout]; ok { + if strVal, ok := val.(string); ok { + timeout, err := time.ParseDuration(strVal) + if err == nil { + self[KeyCachedHandshakeTimeout] = timeout + } + return timeout, errors.Wrapf(err, "unable to parse handshake timeout '%s' to duration", strVal) + } else { + return 0, errors.New("invalid handshake timeout, must be string value") + } + } + + return 0, nil +} + type ProxyType string const ( diff --git a/dtls/address.go b/dtls/address.go index 3328e1a..7e1c769 100644 --- a/dtls/address.go +++ b/dtls/address.go @@ -46,8 +46,8 @@ func (a *address) DialWithLocalBinding(name string, localBinding string, i *iden return DialWithLocalBinding(a, name, localBinding, i, timeout) } -func (a *address) Listen(name string, i *identity.TokenId, acceptF func(transport.Conn), _ transport.Configuration) (io.Closer, error) { - return Listen(a, name, i, acceptF) +func (a *address) Listen(name string, i *identity.TokenId, acceptF func(transport.Conn), tcfg transport.Configuration) (io.Closer, error) { + return Listen(a, name, i, tcfg, acceptF) } func (a *address) MustListen(name string, i *identity.TokenId, acceptF func(transport.Conn), tcfg transport.Configuration) io.Closer { @@ -62,7 +62,7 @@ func (a *address) String() string { return a.original } -func (a address) Type() string { +func (a *address) Type() string { return Type } @@ -75,7 +75,7 @@ func (a *address) Hostname() string { return a.UDPAddr.IP.String() } -func (a address) Port() uint16 { +func (a *address) Port() uint16 { return uint16(a.UDPAddr.Port) } diff --git a/dtls/connection.go b/dtls/connection.go index 36c09ff..e012108 100644 --- a/dtls/connection.go +++ b/dtls/connection.go @@ -19,13 +19,17 @@ package dtls import ( "crypto/x509" "github.com/openziti/transport/v2" - "github.com/pion/dtls/v2" + "github.com/pion/dtls/v3" "github.com/pkg/errors" ) func getPeerCerts(conn *dtls.Conn) ([]*x509.Certificate, error) { var certs []*x509.Certificate - for _, certBytes := range conn.ConnectionState().PeerCertificates { + connState, ok := conn.ConnectionState() + if !ok { + return nil, errors.New("unable to get dtls connection state, couldn't get peer certificates") + } + for _, certBytes := range connState.PeerCertificates { cert, err := x509.ParseCertificate(certBytes) if err != nil { return nil, errors.Wrap(err, "couldn't parse peer cert") diff --git a/dtls/dialer.go b/dtls/dialer.go index 823035f..bb8e0aa 100644 --- a/dtls/dialer.go +++ b/dtls/dialer.go @@ -22,7 +22,8 @@ import ( "github.com/michaelquigley/pfxlog" "github.com/openziti/identity" "github.com/openziti/transport/v2" - "github.com/pion/dtls/v2" + "github.com/pion/dtls/v3" + "github.com/pkg/errors" "net" "time" ) @@ -32,16 +33,17 @@ func Dial(addr *address, name string, i *identity.TokenId, timeout time.Duration } func DialWithLocalBinding(addr *address, name, localBinding string, i *identity.TokenId, timeout time.Duration) (transport.Conn, error) { + log := pfxlog.Logger() + log.WithField("address", addr.String()).Debug("dialing") + if addr.err != nil { return nil, addr.err } - ip, err := transport.ResolveLocalBinding(localBinding) - if err != nil { - return nil, err + ip, closeErr := transport.ResolveLocalBinding(localBinding) + if closeErr != nil { + return nil, closeErr } - log := pfxlog.Logger() - cfg := &dtls.Config{ Certificates: []tls.Certificate{*i.Cert()}, //ExtendedMasterSecret: dtls.RequireExtendedMasterSecret, @@ -53,9 +55,14 @@ func DialWithLocalBinding(addr *address, name, localBinding string, i *identity. localAddr = &net.UDPAddr{IP: ip} } - udpConn, err := net.DialUDP("udp", localAddr, &addr.UDPAddr) - if err != nil { - return nil, err + udpConn, closeErr := net.ListenUDP("udp", localAddr) + if closeErr != nil { + return nil, closeErr + } + + conn, closeErr := dtls.Client(udpConn, &addr.UDPAddr, cfg) + if closeErr != nil { + return nil, closeErr } ctx := context.Background() @@ -63,19 +70,25 @@ func DialWithLocalBinding(addr *address, name, localBinding string, i *identity. if timeout > 0 { ctx, cancelF = context.WithTimeout(ctx, timeout) } - conn, err := dtls.ClientWithContext(ctx, udpConn, cfg) + closeErr = conn.HandshakeContext(ctx) cancelF() - if err != nil { - return nil, err + if closeErr != nil { + if closeErr := conn.Close(); closeErr != nil { + log.WithError(closeErr).Error("error closing connection") + } + return nil, errors.Wrap(closeErr, "dtls handshake error") } - log.Debugf("server provided [%d] certificates", len(conn.ConnectionState().PeerCertificates)) - - certs, err := getPeerCerts(conn) - if err != nil { - return nil, err + certs, closeErr := getPeerCerts(conn) + if closeErr != nil { + if closeErr = conn.Close(); closeErr != nil { + log.WithError(closeErr).Error("error closing connection") + } + return nil, errors.Wrap(closeErr, "error getting peer certificates") } + log.Debugf("server provided [%d] certificates", len(certs)) + return &Connection{ detail: &transport.ConnectionDetail{ Address: addr.String(), diff --git a/dtls/listener.go b/dtls/listener.go index 8bc4c7c..aa1de93 100644 --- a/dtls/listener.go +++ b/dtls/listener.go @@ -22,7 +22,7 @@ import ( "github.com/michaelquigley/pfxlog" "github.com/openziti/identity" "github.com/openziti/transport/v2" - "github.com/pion/dtls/v2" + "github.com/pion/dtls/v3" "github.com/sirupsen/logrus" "io" "net" @@ -30,10 +30,22 @@ import ( "time" ) -func Listen(addr *address, name string, i *identity.TokenId, acceptF func(transport.Conn)) (io.Closer, error) { +const DefaultHandshakeTimeout = 30 * time.Second + +func Listen(addr *address, name string, i *identity.TokenId, tcfg transport.Configuration, acceptF func(transport.Conn)) (io.Closer, error) { if addr.err != nil { return nil, addr.err } + + timeout, err := tcfg.GetHandshakeTimeout() + if err != nil { + return nil, err + } + + if timeout == 0 { + timeout = DefaultHandshakeTimeout + } + log := pfxlog.ContextLogger(name + "/" + addr.String()).Entry var certs []tls.Certificate @@ -49,9 +61,6 @@ func Listen(addr *address, name string, i *identity.TokenId, acceptF func(transp RootCAs: i.CA(), //CipherSuites: tlz.GetCipherSuites(), // Create timeout context for accepted connection. - ConnectContextMaker: func() (context.Context, func()) { - return context.WithTimeout(context.Background(), 30*time.Second) - }, } listener, err := dtls.Listen("udp", &addr.UDPAddr, cfg) @@ -63,6 +72,7 @@ func Listen(addr *address, name string, i *identity.TokenId, acceptF func(transp name: name, listener: listener, acceptF: acceptF, + timeout: timeout, } go result.acceptLoop(log) @@ -75,6 +85,7 @@ type acceptor struct { listener net.Listener acceptF func(transport.Conn) closed atomic.Bool + timeout time.Duration } func (self *acceptor) Close() error { @@ -99,6 +110,22 @@ func (self *acceptor) acceptLoop(log *logrus.Entry) { } conn := socket.(*dtls.Conn) + ctx := context.Background() + cancelF := func() {} + if self.timeout > 0 { + ctx, cancelF = context.WithTimeout(ctx, self.timeout) + } + err = conn.HandshakeContext(ctx) + cancelF() + + if err != nil { + log.WithError(err).Error("dtls handshake error") + if err = conn.Close(); err != nil { + log.WithError(err).Error("error closing connection") + } + continue + } + certs, err := getPeerCerts(conn) if err != nil { log.WithError(err).Error("unable to parse peer certificates") @@ -115,7 +142,7 @@ func (self *acceptor) acceptLoop(log *logrus.Entry) { Name: self.name, }, certs: certs, - Conn: socket.(*dtls.Conn), + Conn: conn, } self.acceptF(connection) } diff --git a/go.mod b/go.mod index 9df6d0b..6db9113 100644 --- a/go.mod +++ b/go.mod @@ -9,11 +9,11 @@ require ( github.com/openziti/dilithium v0.3.3 github.com/openziti/foundation/v2 v2.0.48 github.com/openziti/identity v1.0.84 - github.com/pion/dtls/v2 v2.2.10 + github.com/pion/dtls/v3 v3.0.1 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - golang.org/x/net v0.24.0 + golang.org/x/net v0.27.0 nhooyr.io/websocket v1.8.11 ) @@ -25,18 +25,18 @@ require ( github.com/miekg/pkcs11 v1.1.1 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/pion/logging v0.2.2 // indirect - github.com/pion/transport/v2 v2.2.4 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/parallaxsecond/parsec-client-go v0.0.0-20221025095442-f0a77d263cf9 // indirect + github.com/pion/transport/v3 v3.0.7 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.16.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index bc1b72b..27a6b5f 100644 --- a/go.sum +++ b/go.sum @@ -332,12 +332,12 @@ github.com/parallaxsecond/parsec-client-go v0.0.0-20221025095442-f0a77d263cf9/go github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pion/dtls/v2 v2.2.10 h1:u2Axk+FyIR1VFTPurktB+1zoEPGIW3bmyj3LEFrXjAA= -github.com/pion/dtls/v2 v2.2.10/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= +github.com/pion/dtls/v3 v3.0.1 h1:0kmoaPYLAo0md/VemjcrAXQiSf8U+tuU3nDYVNpEKaw= +github.com/pion/dtls/v3 v3.0.1/go.mod h1:dfIXcFkKoujDQ+jtd8M6RgqKK3DuaUilm3YatAbGp5k= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= -github.com/pion/transport/v2 v2.2.4 h1:41JJK6DZQYSeVLxILA2+F4ZkKb4Xd/tFJZRFZQ9QAlo= -github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= +github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0= +github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -416,17 +416,12 @@ github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -481,10 +476,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -522,7 +515,6 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -570,12 +562,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -603,7 +591,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -669,22 +656,14 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -694,11 +673,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -759,7 +735,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From d94cf0042cd5035292158c227e8b386c94156807 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 19 Aug 2024 13:07:15 -0400 Subject: [PATCH 2/2] bump go version to 1.21 --- .github/dependabot.yml | 20 ++++++++++++++++++++ .github/workflows/golangci-lint.yml | 13 ++++++++----- .github/workflows/update-dependency.yml | 4 ++-- go.mod | 2 +- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fad206f..1bc8f88 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,27 @@ updates: schedule: interval: daily open-pull-requests-limit: 10 + groups: + non-major: + applies-to: version-updates + update-types: + - "minor" + - "patch" ignore: - dependency-name: github.com/lucas-clemente/quic-go versions: - "> 0.18.1" + +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + groups: + all: + applies-to: version-updates + update-types: + - "major" + - "minor" + - "patch" + diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e82b6cb..18625dc 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -11,15 +11,18 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 with: - go-version: 1.19 - - uses: actions/checkout@v3 + go-version-file: ./go.mod + + - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.49 + version: v1.57.2 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/.github/workflows/update-dependency.yml b/.github/workflows/update-dependency.yml index 8d5f20f..f6bf3ad 100644 --- a/.github/workflows/update-dependency.yml +++ b/.github/workflows/update-dependency.yml @@ -17,9 +17,9 @@ jobs: fetch-depth: 0 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: '~1.19.0' + go-version-file: ./go.mod - name: Install Ziti CI uses: openziti/ziti-ci@v1 diff --git a/go.mod b/go.mod index 6db9113..8015721 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/openziti/transport/v2 -go 1.19 +go 1.21 require ( github.com/gorilla/mux v1.8.1