What version of Go are you using (go version)?
go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build454871894=/tmp/go-build -gno-record-gcc-switches"
What did you do?
see https://play.golang.org/p/VeX1YzLJKk1
Since it seems that network request can not be done in the play environment, try it locally
As in the sample code above, if the certificate used in the host name of the communication destination is a wild card, since the verification of ServerName specified by tls.Config{ServerName: u} is insufficient, including URLScheme etc. Even though it can pass.
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Should not display error as hostname incorrect
What did you see instead?
HTTPS request succeed
What version of Go are you using (
go version)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env)?What did you do?
see https://play.golang.org/p/VeX1YzLJKk1
Since it seems that network request can not be done in the play environment, try it locally
As in the sample code above, if the certificate used in the host name of the communication destination is a wild card, since the verification of ServerName specified by
tls.Config{ServerName: u}is insufficient, including URLScheme etc. Even though it can pass.If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Should not display error as hostname incorrect
What did you see instead?
HTTPS request succeed