diff --git a/.github/workflows/go-windows.yml b/.github/workflows/go-windows.yml index f15456b0b..8c38cff86 100644 --- a/.github/workflows/go-windows.yml +++ b/.github/workflows/go-windows.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.19.x, 1.21.x] + go-version: [1.20.x, 1.21.x] os: [windows-latest] steps: - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 59c4a2396..b6774e820 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.19.x, 1.21.x] + go-version: [1.20.x, 1.21.x] os: [ubuntu-latest] steps: - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} diff --git a/utils.go b/utils.go index e39eba028..91eada0bf 100644 --- a/utils.go +++ b/utils.go @@ -21,6 +21,7 @@ import ( "context" "crypto/md5" fipssha256 "crypto/sha256" + "crypto/tls" "encoding/base64" "encoding/hex" "encoding/xml" @@ -622,7 +623,7 @@ func IsNetworkOrHostDown(err error, expectTimeouts bool) bool { urlErr := &url.Error{} if errors.As(err, &urlErr) { switch urlErr.Err.(type) { - case *net.DNSError, *net.OpError, net.UnknownNetworkError: + case *net.DNSError, *net.OpError, net.UnknownNetworkError, *tls.CertificateVerificationError: return true } } @@ -649,7 +650,12 @@ func IsNetworkOrHostDown(err error, expectTimeouts bool) bool { case strings.Contains(err.Error(), "connection refused"): // If err is connection refused return true - + case strings.Contains(err.Error(), "server gave HTTP response to HTTPS client"): + // If err is TLS client is used with HTTP server + return true + case strings.Contains(err.Error(), "Client sent an HTTP request to an HTTPS server"): + // If err is plain-text Client is used with a HTTPS server + return true case strings.Contains(strings.ToLower(err.Error()), "503 service unavailable"): // Denial errors return true