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 %
``` `
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 failureWith GO 1.22.2