[go] cmd/go/internal/vcs: error out if the requested repo does not support a secure protocol

204 views
Skip to first unread message

Bryan Mills (Gerrit)

unread,
Nov 2, 2023, 3:12:26 PM11/2/23
to Bryan Mills, goph...@pubsubhelper.golang.org, Michael Matloob, Roland Shoemaker, golang-co...@googlegroups.com

Attention is currently required from: Michael Matloob.

Patch set 2:Commit-Queue +1

View Change

    To view, visit change 539321. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
    Gerrit-Change-Number: 539321
    Gerrit-PatchSet: 2
    Gerrit-Owner: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-CC: Roland Shoemaker <rol...@golang.org>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 02 Nov 2023 19:12:21 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Michael Matloob (Gerrit)

    unread,
    Nov 3, 2023, 3:28:17 PM11/3/23
    to Bryan Mills, goph...@pubsubhelper.golang.org, Go LUCI, Roland Shoemaker, golang-co...@googlegroups.com

    Attention is currently required from: Bryan Mills.

    Patch set 2:Code-Review +2

    View Change

      To view, visit change 539321. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
      Gerrit-Change-Number: 539321
      Gerrit-PatchSet: 2
      Gerrit-Owner: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-CC: Roland Shoemaker <rol...@golang.org>
      Gerrit-Attention: Bryan Mills <bcm...@google.com>
      Gerrit-Comment-Date: Fri, 03 Nov 2023 19:28:13 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Roland Shoemaker (Gerrit)

      unread,
      Nov 3, 2023, 4:01:30 PM11/3/23
      to Bryan Mills, goph...@pubsubhelper.golang.org, Michael Matloob, Go LUCI, golang-co...@googlegroups.com

      Attention is currently required from: Bryan Mills.

      Patch set 2:Code-Review +1

      View Change

        To view, visit change 539321. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
        Gerrit-Change-Number: 539321
        Gerrit-PatchSet: 2
        Gerrit-Owner: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
        Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Attention: Bryan Mills <bcm...@google.com>
        Gerrit-Comment-Date: Fri, 03 Nov 2023 20:01:23 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes

        Bryan Mills (Gerrit)

        unread,
        Nov 6, 2023, 4:04:24 PM11/6/23
        to Bryan Mills, goph...@pubsubhelper.golang.org, Roland Shoemaker, Michael Matloob, Go LUCI, golang-co...@googlegroups.com

        Patch set 2:Auto-Submit +1

        View Change

          To view, visit change 539321. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
          Gerrit-Change-Number: 539321
          Gerrit-PatchSet: 2
          Gerrit-Owner: Bryan Mills <bcm...@google.com>
          Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
          Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
          Gerrit-Comment-Date: Mon, 06 Nov 2023 21:04:20 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes

          Gopher Robot (Gerrit)

          unread,
          Nov 6, 2023, 4:10:10 PM11/6/23
          to Bryan Mills, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Roland Shoemaker, Michael Matloob, Go LUCI, golang-co...@googlegroups.com

          Gopher Robot submitted this change.

          View Change

          Approvals: Bryan Mills: Automatically submit change Roland Shoemaker: Looks good to me, but someone else must approve Go LUCI: TryBots succeeded Michael Matloob: Looks good to me, approved
          cmd/go/internal/vcs: error out if the requested repo does not support a secure protocol

          Fixes #63845.

          Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
          Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
          Reviewed-on: https://go-review.googlesource.com/c/go/+/539321
          Reviewed-by: Michael Matloob <mat...@golang.org>
          LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
          Reviewed-by: Roland Shoemaker <rol...@golang.org>
          Auto-Submit: Bryan Mills <bcm...@google.com>
          ---
          M src/cmd/go/internal/vcs/vcs.go
          A src/cmd/go/testdata/script/mod_insecure_issue63845.txt
          2 files changed, 47 insertions(+), 6 deletions(-)

          diff --git a/src/cmd/go/internal/vcs/vcs.go b/src/cmd/go/internal/vcs/vcs.go
          index 4d6cdbc..8550f2a 100644
          --- a/src/cmd/go/internal/vcs/vcs.go
          +++ b/src/cmd/go/internal/vcs/vcs.go
          @@ -1171,18 +1171,31 @@
          var ok bool
          repoURL, ok = interceptVCSTest(repo, vcs, security)
          if !ok {
          - scheme := vcs.Scheme[0] // default to first scheme
          - if vcs.PingCmd != "" {
          - // If we know how to test schemes, scan to find one.
          + scheme, err := func() (string, error) {
          for _, s := range vcs.Scheme {
          if security == web.SecureOnly && !vcs.isSecureScheme(s) {
          continue
          }
          - if vcs.Ping(s, repo) == nil {
          - scheme = s
          - break
          +
          + // If we know how to ping URL schemes for this VCS,
          + // check that this repo works.
          + // Otherwise, default to the first scheme
          + // that meets the requested security level.
          + if vcs.PingCmd == "" {
          + return s, nil
          + }
          + if err := vcs.Ping(s, repo); err == nil {
          + return s, nil
          }
          }
          + securityFrag := ""
          + if security == web.SecureOnly {
          + securityFrag = "secure "
          + }
          + return "", fmt.Errorf("no %sprotocol found for repository", securityFrag)
          + }()
          + if err != nil {
          + return nil, err
          }
          repoURL = scheme + "://" + repo
          }
          diff --git a/src/cmd/go/testdata/script/mod_insecure_issue63845.txt b/src/cmd/go/testdata/script/mod_insecure_issue63845.txt
          new file mode 100644
          index 0000000..c051c05
          --- /dev/null
          +++ b/src/cmd/go/testdata/script/mod_insecure_issue63845.txt
          @@ -0,0 +1,28 @@
          +# Regression test for https://go.dev/issue/63845:
          +# If 'git ls-remote' fails for all secure protocols,
          +# we should fail instead of falling back to an arbitrary protocol.
          +#
          +# Note that this test does not use the local vcweb test server
          +# (vcs-test.golang.org), because the hook for redirecting to that
          +# server bypasses the "ping to determine protocol" logic
          +# in cmd/go/internal/vcs.
          +
          +[!net:golang.org] skip
          +[!git] skip
          +[short] skip 'tries to access a nonexistent external Git repo'
          +
          +env GOPRIVATE=golang.org
          +env CURLOPT_TIMEOUT_MS=100
          +env GIT_SSH_COMMAND=false
          +
          +! go get -x golang.org/nonexist.git@latest
          +stderr '^git ls-remote https://golang.org/nonexist$'
          +stderr '^git ls-remote git\+ssh://golang.org/nonexist'
          +stderr '^git ls-remote ssh://golang.org/nonexist$'
          +! stderr 'git://'
          +stderr '^go: golang.org/nonexist.git@latest: no secure protocol found for repository$'
          +
          +-- go.mod --
          +module example
          +
          +go 1.19

          To view, visit change 539321. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-MessageType: merged
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
          Gerrit-Change-Number: 539321
          Gerrit-PatchSet: 3
          Gerrit-Owner: Bryan Mills <bcm...@google.com>
          Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
          Gerrit-Reviewer: Gopher Robot <go...@golang.org>

          Bryan Mills (Gerrit)

          unread,
          Nov 6, 2023, 4:32:00 PM11/6/23
          to goph...@pubsubhelper.golang.org, Bryan Mills, golang-co...@googlegroups.com

          Bryan Mills has uploaded this change for review.

          View Change

          cmd/go/internal/vcs: error out if the requested repo does not support a secure protocol

          Updates #63845.
          Fixes #63973.

          Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8

          Reviewed-on: https://go-review.googlesource.com/c/go/+/539321
          Reviewed-by: Michael Matloob <mat...@golang.org>
          LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
          Reviewed-by: Roland Shoemaker <rol...@golang.org>
          Auto-Submit: Bryan Mills <bcm...@google.com>
          (cherry picked from commit be26ae18caf7ddffca4073333f80d0d9e76483c3)

          ---
          M src/cmd/go/internal/vcs/vcs.go
          A src/cmd/go/testdata/script/mod_insecure_issue63845.txt
          2 files changed, 47 insertions(+), 6 deletions(-)

          diff --git a/src/cmd/go/internal/vcs/vcs.go b/src/cmd/go/internal/vcs/vcs.go
          index c65dd0f..dbf16d1 100644
          --- a/src/cmd/go/internal/vcs/vcs.go
          +++ b/src/cmd/go/internal/vcs/vcs.go
          @@ -1204,18 +1204,31 @@

          To view, visit change 540257. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-MessageType: newchange
          Gerrit-Project: go
          Gerrit-Branch: release-branch.go1.21
          Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
          Gerrit-Change-Number: 540257
          Gerrit-PatchSet: 1
          Gerrit-Owner: Bryan Mills <bcm...@google.com>

          Bryan Mills (Gerrit)

          unread,
          Nov 6, 2023, 4:32:11 PM11/6/23
          to Bryan Mills, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

          Patch set 1:Commit-Queue +1

          View Change

            To view, visit change 540257. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: release-branch.go1.21
            Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
            Gerrit-Change-Number: 540257
            Gerrit-PatchSet: 1
            Gerrit-Owner: Bryan Mills <bcm...@google.com>
            Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
            Gerrit-Comment-Date: Mon, 06 Nov 2023 21:32:08 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes

            Bryan Mills (Gerrit)

            unread,
            Nov 6, 2023, 4:32:21 PM11/6/23
            to Bryan Mills, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

            Bryan Mills uploaded patch set #2 to this change.

            View Change

            [release-branch.go1.21] cmd/go/internal/vcs: error out if the requested repo does not support a secure protocol


            Updates #63845.
            Fixes #63973.

            Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
            Reviewed-on: https://go-review.googlesource.com/c/go/+/539321
            Reviewed-by: Michael Matloob <mat...@golang.org>
            LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
            Reviewed-by: Roland Shoemaker <rol...@golang.org>
            Auto-Submit: Bryan Mills <bcm...@google.com>
            (cherry picked from commit be26ae18caf7ddffca4073333f80d0d9e76483c3)
            ---
            M src/cmd/go/internal/vcs/vcs.go
            A src/cmd/go/testdata/script/mod_insecure_issue63845.txt
            2 files changed, 47 insertions(+), 6 deletions(-)

            To view, visit change 540257. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-MessageType: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: release-branch.go1.21
            Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
            Gerrit-Change-Number: 540257
            Gerrit-PatchSet: 2
            Gerrit-Owner: Bryan Mills <bcm...@google.com>
            Gerrit-Reviewer: Bryan Mills <bcm...@google.com>

            Bryan Mills (Gerrit)

            unread,
            Nov 6, 2023, 4:32:32 PM11/6/23
            to Bryan Mills, goph...@pubsubhelper.golang.org, Roland Shoemaker, Michael Matloob, Go LUCI, golang-co...@googlegroups.com

            Attention is currently required from: Bryan Mills, Roland Shoemaker.

            Patch set 2:Commit-Queue +1

            View Change

              To view, visit change 540257. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-MessageType: comment
              Gerrit-Project: go
              Gerrit-Branch: release-branch.go1.21
              Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
              Gerrit-Change-Number: 540257
              Gerrit-PatchSet: 2
              Gerrit-Owner: Bryan Mills <bcm...@google.com>
              Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
              Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
              Gerrit-CC: Michael Matloob <mat...@golang.org>
              Gerrit-Attention: Bryan Mills <bcm...@google.com>
              Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
              Gerrit-Comment-Date: Mon, 06 Nov 2023 21:32:28 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes

              Bryan Mills (Gerrit)

              unread,
              Nov 6, 2023, 4:34:01 PM11/6/23
              to goph...@pubsubhelper.golang.org, Bryan Mills, golang-co...@googlegroups.com

              Bryan Mills has uploaded this change for review.

              View Change

              [release-branch.go1.20] cmd/go/internal/vcs: error out if the requested repo does not support a secure protocol

              Updates #63845.
              Fixes #63972.


              Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
              Reviewed-on: https://go-review.googlesource.com/c/go/+/539321
              Reviewed-by: Michael Matloob <mat...@golang.org>
              LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
              Reviewed-by: Roland Shoemaker <rol...@golang.org>
              Auto-Submit: Bryan Mills <bcm...@google.com>
              (cherry picked from commit be26ae18caf7ddffca4073333f80d0d9e76483c3)
              ---
              M src/cmd/go/internal/vcs/vcs.go
              A src/cmd/go/testdata/script/mod_insecure_issue63845.txt
              2 files changed, 47 insertions(+), 6 deletions(-)

              diff --git a/src/cmd/go/internal/vcs/vcs.go b/src/cmd/go/internal/vcs/vcs.go
              index 12ea052..695bb4b 100644
              --- a/src/cmd/go/internal/vcs/vcs.go
              +++ b/src/cmd/go/internal/vcs/vcs.go
              @@ -1179,18 +1179,31 @@

              To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-MessageType: newchange
              Gerrit-Project: go
              Gerrit-Branch: release-branch.go1.20
              Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
              Gerrit-Change-Number: 540335

              Bryan Mills (Gerrit)

              unread,
              Nov 6, 2023, 4:34:19 PM11/6/23
              to Bryan Mills, goph...@pubsubhelper.golang.org, Roland Shoemaker, Michael Matloob, golang-co...@googlegroups.com

              Attention is currently required from: Roland Shoemaker.

              Patch set 1:Commit-Queue +1

              View Change

                To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-MessageType: comment
                Gerrit-Project: go
                Gerrit-Branch: release-branch.go1.20
                Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                Gerrit-Change-Number: 540335
                Gerrit-PatchSet: 1
                Gerrit-Owner: Bryan Mills <bcm...@google.com>
                Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
                Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
                Gerrit-CC: Michael Matloob <mat...@golang.org>
                Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
                Gerrit-Comment-Date: Mon, 06 Nov 2023 21:34:15 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes

                Bryan Mills (Gerrit)

                unread,
                Nov 6, 2023, 4:48:38 PM11/6/23
                to Bryan Mills, goph...@pubsubhelper.golang.org, Go LUCI, Roland Shoemaker, Michael Matloob, golang-co...@googlegroups.com

                Attention is currently required from: Roland Shoemaker.

                Patch set 2:Commit-Queue +1

                View Change

                  To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

                  Gerrit-MessageType: comment
                  Gerrit-Project: go
                  Gerrit-Branch: release-branch.go1.20
                  Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                  Gerrit-Change-Number: 540335
                  Gerrit-PatchSet: 2
                  Gerrit-Owner: Bryan Mills <bcm...@google.com>
                  Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
                  Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
                  Gerrit-CC: Michael Matloob <mat...@golang.org>
                  Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
                  Gerrit-Comment-Date: Mon, 06 Nov 2023 21:48:34 +0000
                  Gerrit-HasComments: No
                  Gerrit-Has-Labels: Yes

                  Bryan Mills (Gerrit)

                  unread,
                  Nov 6, 2023, 5:17:22 PM11/6/23
                  to Bryan Mills, goph...@pubsubhelper.golang.org, Go LUCI, Roland Shoemaker, Michael Matloob, golang-co...@googlegroups.com

                  Attention is currently required from: Roland Shoemaker.

                  View Change

                  1 comment:

                  • Patchset:

                    • Patch Set #2:

                      Started a rerun of `windows-amd64-longtest` due to #59494.

                  To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

                  Gerrit-MessageType: comment
                  Gerrit-Project: go
                  Gerrit-Branch: release-branch.go1.20
                  Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                  Gerrit-Change-Number: 540335
                  Gerrit-PatchSet: 2
                  Gerrit-Owner: Bryan Mills <bcm...@google.com>
                  Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
                  Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
                  Gerrit-CC: Michael Matloob <mat...@golang.org>
                  Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
                  Gerrit-Comment-Date: Mon, 06 Nov 2023 22:17:18 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No

                  Bryan Mills (Gerrit)

                  unread,
                  Nov 7, 2023, 3:47:55 PM11/7/23
                  to Bryan Mills, goph...@pubsubhelper.golang.org, Go LUCI, Roland Shoemaker, Michael Matloob, golang-co...@googlegroups.com

                  Attention is currently required from: Roland Shoemaker.

                  Bryan Mills removed a vote from this change.

                  View Change

                  Removed LUCI-TryBot-Result-1 by Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>

                  To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

                  Gerrit-MessageType: deleteVote

                  Bryan Mills (Gerrit)

                  unread,
                  Nov 7, 2023, 3:48:04 PM11/7/23
                  to Bryan Mills, goph...@pubsubhelper.golang.org, Go LUCI, Roland Shoemaker, Michael Matloob, golang-co...@googlegroups.com

                  Attention is currently required from: Roland Shoemaker.

                  Patch set 2:Commit-Queue +1

                  View Change

                    To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-MessageType: comment
                    Gerrit-Project: go
                    Gerrit-Branch: release-branch.go1.20
                    Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                    Gerrit-Change-Number: 540335
                    Gerrit-PatchSet: 2
                    Gerrit-Owner: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
                    Gerrit-CC: Michael Matloob <mat...@golang.org>
                    Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
                    Gerrit-Comment-Date: Tue, 07 Nov 2023 20:48:01 +0000
                    Gerrit-HasComments: No
                    Gerrit-Has-Labels: Yes

                    Dmitri Shuralyov (Gerrit)

                    unread,
                    Nov 27, 2023, 4:11:41 PM11/27/23
                    to Bryan Mills, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Roland Shoemaker, Michael Matloob, Go LUCI, golang-co...@googlegroups.com

                    Attention is currently required from: Bryan Mills, Roland Shoemaker.

                    Patch set 2:Auto-Submit +1Code-Review +2

                    View Change

                    1 comment:

                    To view, visit change 540257. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-MessageType: comment
                    Gerrit-Project: go
                    Gerrit-Branch: release-branch.go1.21
                    Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                    Gerrit-Change-Number: 540257
                    Gerrit-PatchSet: 2
                    Gerrit-Owner: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
                    Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
                    Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
                    Gerrit-CC: Michael Matloob <mat...@golang.org>
                    Gerrit-Attention: Bryan Mills <bcm...@google.com>
                    Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
                    Gerrit-Comment-Date: Mon, 27 Nov 2023 21:11:37 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes

                    Dmitri Shuralyov (Gerrit)

                    unread,
                    Nov 27, 2023, 4:11:53 PM11/27/23
                    to Bryan Mills, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Go LUCI, Roland Shoemaker, Michael Matloob, golang-co...@googlegroups.com

                    Attention is currently required from: Bryan Mills, Roland Shoemaker.

                    Patch set 2:Auto-Submit +1Code-Review +2

                    View Change

                    1 comment:

                    To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-MessageType: comment
                    Gerrit-Project: go
                    Gerrit-Branch: release-branch.go1.20
                    Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                    Gerrit-Change-Number: 540335
                    Gerrit-PatchSet: 2
                    Gerrit-Owner: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
                    Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
                    Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
                    Gerrit-CC: Michael Matloob <mat...@golang.org>
                    Gerrit-Attention: Bryan Mills <bcm...@google.com>
                    Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
                    Gerrit-Comment-Date: Mon, 27 Nov 2023 21:11:50 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes

                    Gopher Robot (Gerrit)

                    unread,
                    Nov 27, 2023, 4:12:24 PM11/27/23
                    to Bryan Mills, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Dmitri Shuralyov, Dmitri Shuralyov, Roland Shoemaker, Michael Matloob, Go LUCI, golang-co...@googlegroups.com

                    Gopher Robot submitted this change.

                    View Change

                    Approvals: Dmitri Shuralyov: Looks good to me, approved; Automatically submit change Go LUCI: TryBots succeeded
                    [release-branch.go1.21] cmd/go/internal/vcs: error out if the requested repo does not support a secure protocol

                    Updates #63845.
                    Fixes #63973.


                    Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                    Reviewed-on: https://go-review.googlesource.com/c/go/+/539321
                    Reviewed-by: Michael Matloob <mat...@golang.org>
                    LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
                    Reviewed-by: Roland Shoemaker <rol...@golang.org>
                    Auto-Submit: Bryan Mills <bcm...@google.com>
                    (cherry picked from commit be26ae18caf7ddffca4073333f80d0d9e76483c3)
                    Reviewed-on: https://go-review.googlesource.com/c/go/+/540257
                    Auto-Submit: Dmitri Shuralyov <dmit...@google.com>
                    Reviewed-by: Dmitri Shuralyov <dmit...@google.com>

                    ---
                    M src/cmd/go/internal/vcs/vcs.go
                    A src/cmd/go/testdata/script/mod_insecure_issue63845.txt
                    2 files changed, 47 insertions(+), 6 deletions(-)

                    
                    
                    diff --git a/src/cmd/go/internal/vcs/vcs.go b/src/cmd/go/internal/vcs/vcs.go
                    index c65dd0f..dbf16d1 100644
                    --- a/src/cmd/go/internal/vcs/vcs.go
                    +++ b/src/cmd/go/internal/vcs/vcs.go
                    @@ -1204,18 +1204,31 @@

                    To view, visit change 540257. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-MessageType: merged
                    Gerrit-Project: go
                    Gerrit-Branch: release-branch.go1.21
                    Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                    Gerrit-Change-Number: 540257
                    Gerrit-PatchSet: 3
                    Gerrit-Owner: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Bryan Mills <bcm...@google.com>
                    Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
                    Gerrit-Reviewer: Gopher Robot <go...@golang.org>

                    Gopher Robot (Gerrit)

                    unread,
                    Nov 27, 2023, 4:12:53 PM11/27/23
                    to Bryan Mills, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Dmitri Shuralyov, Dmitri Shuralyov, Go LUCI, Roland Shoemaker, Michael Matloob, golang-co...@googlegroups.com

                    Gopher Robot submitted this change.

                    View Change

                    Approvals: Dmitri Shuralyov: Looks good to me, approved; Automatically submit change Go LUCI: TryBots succeeded
                    [release-branch.go1.20] cmd/go/internal/vcs: error out if the requested repo does not support a secure protocol

                    Updates #63845.
                    Fixes #63972.


                    Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                    Reviewed-on: https://go-review.googlesource.com/c/go/+/539321
                    Reviewed-by: Michael Matloob <mat...@golang.org>
                    LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
                    Reviewed-by: Roland Shoemaker <rol...@golang.org>
                    Auto-Submit: Bryan Mills <bcm...@google.com>
                    (cherry picked from commit be26ae18caf7ddffca4073333f80d0d9e76483c3)

                    Auto-Submit: Dmitri Shuralyov <dmit...@google.com>
                    Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
                    ---
                    M src/cmd/go/internal/vcs/vcs.go
                    A src/cmd/go/testdata/script/mod_insecure_issue63845.txt
                    2 files changed, 47 insertions(+), 6 deletions(-)

                    
                    
                    diff --git a/src/cmd/go/internal/vcs/vcs.go b/src/cmd/go/internal/vcs/vcs.go
                    index 12ea052..695bb4b 100644
                    --- a/src/cmd/go/internal/vcs/vcs.go
                    +++ b/src/cmd/go/internal/vcs/vcs.go
                    @@ -1179,18 +1179,31 @@
                    index 0000000..5fa6a4f

                    --- /dev/null
                    +++ b/src/cmd/go/testdata/script/mod_insecure_issue63845.txt
                    @@ -0,0 +1,28 @@
                    +# Regression test for https://go.dev/issue/63845:
                    +# If 'git ls-remote' fails for all secure protocols,
                    +# we should fail instead of falling back to an arbitrary protocol.
                    +#
                    +# Note that this test does not use the local vcweb test server
                    +# (vcs-test.golang.org), because the hook for redirecting to that
                    +# server bypasses the "ping to determine protocol" logic
                    +# in cmd/go/internal/vcs.
                    +
                    +[!net] skip

                    +[!git] skip
                    +[short] skip 'tries to access a nonexistent external Git repo'
                    +
                    +env GOPRIVATE=golang.org
                    +env CURLOPT_TIMEOUT_MS=100
                    +env GIT_SSH_COMMAND=false
                    +
                    +! go get -x golang.org/nonexist.git@latest
                    +stderr '^git ls-remote https://golang.org/nonexist$'
                    +stderr '^git ls-remote git\+ssh://golang.org/nonexist'
                    +stderr '^git ls-remote ssh://golang.org/nonexist$'
                    +! stderr 'git://'
                    +stderr '^go: golang.org/nonexist.git@latest: no secure protocol found for repository$'
                    +
                    +-- go.mod --
                    +module example
                    +
                    +go 1.19

                    To view, visit change 540335. To unsubscribe, or for help writing mail filters, visit settings.

                    Gerrit-MessageType: merged
                    Gerrit-Project: go
                    Gerrit-Branch: release-branch.go1.20
                    Gerrit-Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8
                    Gerrit-Change-Number: 540335
                    Reply all
                    Reply to author
                    Forward
                    0 new messages