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

crypto/x509: failed to load system roots and no roots provided #42414

Closed
Poor12 opened this issue Nov 6, 2020 · 16 comments
Closed

crypto/x509: failed to load system roots and no roots provided #42414

Poor12 opened this issue Nov 6, 2020 · 16 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Milestone

Comments

@Poor12
Copy link

Poor12 commented Nov 6, 2020

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

@bcmills
Copy link
Contributor

bcmills commented Nov 6, 2020

CC @FiloSottile @katiehockman

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 6, 2020
@bcmills bcmills added this to the Unplanned milestone Nov 6, 2020
@Poor12
Copy link
Author

Poor12 commented Nov 8, 2020

It seems system error. I reinstalled the system and fixed it.

@Poor12 Poor12 closed this as completed Nov 8, 2020
@wawa0210
Copy link

wawa0210 commented Nov 14, 2020

I reproduced the problem, very strange.
The version of my macos is Catalina 10.15.7 (recently upgraded). If I install the latest version of golang 1.15, this problem will occur. It was normal before the mac was upgraded.
If I roll back the golang version to 1.14.12, everything is normal.
It seems to be caused by the compatibility of mac os Catalina 10.15.7 and golang 1.15

@Poor12
Copy link
Author

Poor12 commented Nov 14, 2020

Yeah,my situation is just the same.@wawa0210

@wawa0210
Copy link

I suggest that you can reopen this issue for further follow-up by the community

@Poor12 Poor12 reopened this Nov 14, 2020
@wmenjoy
Copy link

wmenjoy commented Dec 10, 2020

yeah, the same problem for me.

@Alex-Wei-HZ
Copy link

Is there any update? On my MacOS Catalina 10.15.6, both go 1.15 and 1.16 meet x509 problem, but go 1.14 succeeds. What should I do if I want to use go 1.16 or even more updated versions?

@shuiRong
Copy link

shuiRong commented May 4, 2021

same here.
go version go1.16.2 darwin/amd64
macOS Big Sur 11.4 Beta

Error: Get "https://www.zhihu.com/hot": x509: 
failed to load system roots and no roots provided; SecTrustSettingsCopyCertificates error: -2070

@wawa0210
Copy link

wawa0210 commented May 4, 2021

@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

@ysrotciv
Copy link

ysrotciv commented May 12, 2021

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.

@Alex-Wei-HZ
Copy link

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.

Trust DigiCert Global Root CA in keychain works! Thanks to @ysrotciv .

@dongfengkuayue
Copy link

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.

It works for me. Thanks to @ysrotciv .

@guozhe001
Copy link

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.

It works!!! Thanks to @ysrotciv .

@seankhliao seankhliao changed the title go get error: x509: failed to load system roots and no roots provided crypto/x509: failed to load system roots and no roots provided Jun 18, 2021
@yhf20071
Copy link

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.

It works. Thanks to @ysrotciv

@mowangdk
Copy link

It works(^▽^) Thanks to @ysrotciv

@gopherbot
Copy link

Change https://golang.org/cl/353132 mentions this issue: crypto/x509: use platform verifier on darwin

@golang golang locked and limited conversation to collaborators Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Projects
None yet
Development

No branches or pull requests