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

x/net/http2: tls: handshake failure with site that does not support HTTP2 #66998

Open
araby-deepsky opened this issue Apr 23, 2024 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@araby-deepsky
Copy link

araby-deepsky commented Apr 23, 2024

This simple program fails to fetch JSON over https with

Error Get "https://www.hydroquebec.com/data/documents-donnees/donnees-ouvertes/json/demande.json": remote error: tls: handshake failure

package main

import (
	"fmt"
	"net/http"
)

const SRC_URL = "https://www.hydroquebec.com/data/documents-donnees/donnees-ouvertes/json/demande.json"

func main() {
	//lambda.Start(handler)
	fmt.Println("Start fetching from ", SRC_URL)

	// Send HTTP GET request to the URL

	resp, err := http.Get(SRC_URL)
	if err != nil {
		fmt.Println("Error", err)
	} else {
		fmt.Println("Response", resp)
	}

}

With GO 1.22.2

% go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/Users/araby/Library/Caches/go-build'
GOENV='/Users/araby/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/araby/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/araby/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/Cellar/go/1.22.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/Cellar/go/1.22.2/libexec/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/araby/git/deep_sky/electricity-emission-factor-hq/fetchUrl/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/13/8cy89d656xj3tt4wxwgthh480000gn/T/go-build806880367=/tmp/go-build -gno-record-gcc-switches -fno-common'
araby@Annes-MacBook-Pro fetchUrl %
``` `
@araby-deepsky
Copy link
Author

The target site www.hydroquebec.com supports neither HTTP/2 nor ALPN

@joedian joedian added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 24, 2024
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