Skip to content

import/path: issue title #69986

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

Closed
dosgo opened this issue Oct 22, 2024 · 3 comments
Closed

import/path: issue title #69986

dosgo opened this issue Oct 22, 2024 · 3 comments

Comments

@dosgo
Copy link

dosgo commented Oct 22, 2024

Go version

go version go1.22.7 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\DosGo\AppData\Local\go-build
set GOENV=C:\Users\DosGo\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\DosGo\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\DosGo\go
set GOPRIVATE=
set GOPROXY=direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.22.7
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\go\src\adbtest\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\DosGo\AppData\Local\Temp\go-build2525950035=/tmp/go-build -gno-record-gcc-switches

What did you do?

The following code keeps returning remote error: tls: certificate required, but it works fine with GetClientCertificate. Golang's own tls server does not need to set GetClientCertificate and works fine.

func main() {
	conn, err := net.Dial("tcp", "192.168.78.34:33285")
	certificates, err := tls.LoadX509KeyPair("cerm.pem", "test.key")
	if err != nil {
		fmt.Printf("certificates error err:%+v\r\n", err)
		return
	}
	tlsConfig := tls.Config{
		MinVersion: tls.VersionTLS13,
		MaxVersion: tls.VersionTLS13,
		Certificates: []tls.Certificate{
			certificates,
		},
		InsecureSkipVerify: true,
	}
	tlsconn := tls.Client(conn, &tlsConfig)
	message_raw := make([]byte, 1024)
	_, err = io.ReadFull(tlsconn, message_raw)
}

What did you see happen?

err:remote error: tls: certificate required

What did you expect to see?

The tls.config Certificates parameter works fine, not sure if the problem is with the server or the tls client.

@seankhliao
Copy link
Member

sounds like a problem with your server.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
@dosgo
Copy link
Author

dosgo commented Oct 22, 2024

Mainly, both rust and java can be connected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants