go: crypto/x509: failed to load system roots and no roots provided
What version of Go are you using (go version
)?
$ go version go version go1.15.4 darwin/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/Users/tiechengshen/Library/Caches/go-build" GOENV="/Users/tiechengshen/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/tiechengshen/go/src/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/tiechengshen/go/src" GOPRIVATE="" GOPROXY="https://goproxy.io" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" 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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/j7/rm372g_j5hn4k7d2x_vz43bw0000gn/T/go-build603228894=/tmp/go-build -gno-record-gcc-switches -fno-common" GOROOT/bin/go version: go version go1.15.4 darwin/amd64 GOROOT/bin/go tool compile -V: compile version go1.15.4 uname -v: Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H2 lldb --version: lldb-1100.0.30.6 Apple Swift version 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9)
What did you do?
go get github.com/golang/glog
What did you expect to see?
go get success
What did you see instead?
go get github.com/golang/glog: module github.com/golang/glog: Get “https://goproxy.io/github.com/golang/glog/@v/list”: x509: failed to load system roots and no roots provided; SecTrustSettingsCopyCertificates error: -25300
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 16 (1 by maintainers)
I met the same problem. My go version is go1.15.3 darwin/amd64. My macOS version is Big Sur 11.1.
I solved this problem by trusting DigiCert Global Root CA in keychain.
@shuiRong @aidenwei @wmenjoy
I have solved the problem. It should be a certificate problem in the keychain access of mac. It seems that there is a certificate authority. I edited it and it was ok. I don’t remember the specific certificate. You can try