Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/tls: Dial error message does not give much context #34197

Open
hramrach opened this issue Sep 9, 2019 · 2 comments

Comments

@hramrach
Copy link

commented Sep 9, 2019

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

go version go1.11.13 linux/amd64

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

go env Output
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mbirc/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mbirc/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib64/go/1.11"
GOTMPDIR=""
GOTOOLDIR="/usr/lib64/go/1.11/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-build241684230=/tmp/go-build -gno-record-gcc-switches"

What did you do?

tls-client.go code
package main

import (
"crypto/tls"
"os"
"log"
)

func main() {
args:= os.Args

config := tls.Config{}
conn, err := tls.Dial("tcp", args[1] + ":" + args[2], &config)
if err != nil {
    log.Fatalf("client: dial: %s", err)
}
defer conn.Close()
log.Println("client: connected to: ", conn.RemoteAddr())

}


This does not work for the successful case but in error case it prints:

client: dial: remote error: tls: handshake failure

What did you expect to see?

Message that allows diagnosing the failure. Why has it failed to connect? Other clients connect fine.

What did you see instead?

Unexplained failure.

@andybons andybons changed the title tls error message unintelligible crypto/tls: Dial error message does not give much context Sep 9, 2019

@andybons andybons added this to the Unplanned milestone Sep 9, 2019

@andybons

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

@hramrach

This comment has been minimized.

Copy link
Author

commented Sep 12, 2019

This is possibly #7758 but without any indication what failed it is hard to tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.