Skip to content

go mod download does not fallback to http if https is not available #36394

Closed
@graywolf

Description

@graywolf

What version of Go are you using (go version)?

$ go version
go version go1.13.5 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/wolf/.cache/go-build"
GOENV="/home/wolf/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/wolf/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/foo/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build915742668=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Given source code:

+   $ tree .
.
├── aaa.go
└── go.mod

0 directories, 2 files
+   $ cat aaa.go
package foo

import (
        "127.0.0.1/foo/bar"
)
+   $ cat go.mod
module xxx

go 1.13

require 127.0.0.1/foo/bar v0.0.0

use sequence of commands:

+   $ nc -l 127.0.0.1 80 &
+   $ go mod download 127.0.0.1/foo/bar

What did you expect to see?

To see some output from netcat.

What did you see instead?

+   $ go mod download 127.0.0.1/foo/bar
go: 127.0.0.1/foo/[email protected]: unrecognized import path "127.0.0.1/foo/bar" (https fetch: Get https://127.0.0.1/foo/bar?go-get=1: dial tcp 127.0.0.1:443: connect: connection refused)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions