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
Open

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

hramrach opened this issue Sep 9, 2019 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@hramrach
Copy link

hramrach 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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 9, 2019
@andybons andybons added this to the Unplanned milestone Sep 9, 2019
@andybons
Copy link
Member

andybons commented Sep 9, 2019

@FiloSottile

@hramrach
Copy link
Author

hramrach 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
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants