opencoff / go-tunnel

TLS/SSL Tunnel - A modern STunnel replacement written in golang
GNU General Public License v2.0
294 stars 42 forks source link

Error with golang 1.17+ / Trick to build with golang 1.16 #7

Closed xi-ao closed 2 years ago

xi-ao commented 2 years ago

Just a tiny trick. If you're on an environment where only Go 1.17+ is available, you might encounter the following error when running the built binary:

$ ./bin/linux-amd64/gotun
panic: qtls.CertificateRequestInfo doesn't match

goroutine 1 [running]:
github.com/marten-seemann/qtls-go1-16.init.0()

In this case, you may want to use this oneliner to build the binary in a temporary Docker container with Go 1.16:

docker run --rm -v $(pwd):/build -w /build -u $(id -u):$(id -g) -e HOME=/build golang:1.16 make

So then:

$ ./bin/linux-amd64/gotun
./bin/linux-amd64/gotun: No config file!
Usage: ./bin/linux-amd64/gotun [options] config-file
opencoff commented 2 years ago

Thanks for the note. The correct fix is to update go.mod with the latest upstream dependency for quic-go and its dependents.

I just did exactly that and now, go-tunnel compiles & runs correctly on golang 1.17