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

x509 SecTrustSettingsCopyCertificates error: -25300 [GO 1.16.2] #45326

Closed
allbuleyu opened this issue Apr 1, 2021 · 5 comments
Closed

x509 SecTrustSettingsCopyCertificates error: -25300 [GO 1.16.2] #45326

allbuleyu opened this issue Apr 1, 2021 · 5 comments

Comments

@allbuleyu
Copy link

What version of Go are you using (go version)?

go version go1.16.2 darwin/arm64

Does this issue reproduce with the latest release?

I don't know.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="auto"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/yu/Library/Caches/go-build"
GOENV="/Users/yu/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/yu/Desktop/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/yu/Desktop/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9x/3dp4l3lx2b53gg02ch87_gd40000gn/T/go-build3449405619=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go get -u gorm.io/gorm
package gorm.io/gorm: unrecognized import path "gorm.io/gorm": https fetch: Get "https://gorm.io/gorm?go-get=1": x509: failed to load system roots and no roots provided; SecTrustSettingsCopyCertificates error: -25300

please help me.

@allbuleyu allbuleyu changed the title go get can't work on mac m1 x509 SecTrustSettingsCopyCertificates error: -25300 [GO 1.16.2] Apr 1, 2021
@9M6
Copy link

9M6 commented Apr 1, 2021

I am on a M1 Macbook and go works like a charm.

  1. How did you install Go?
    I suggest using Homebrew https://formulae.brew.sh/formula/go

  2. Your error from what I see has nothing to do with Go but rather a certificate issue.
    See if you have done any changes to Keychain or any of that sort. See if you have any app, plugin, adblocker that has some root certificate configuration over your system and disable/reinstall them.

Other than that, I am pretty clueless on how you can fix this.

@allbuleyu
Copy link
Author

I am on a M1 Macbook and go works like a charm.

  1. How did you install Go?
    I suggest using Homebrew https://formulae.brew.sh/formula/go
  2. Your error from what I see has nothing to do with Go but rather a certificate issue.
    See if you have done any changes to Keychain or any of that sort. See if you have any app, plugin, adblocker that has some root certificate configuration over your system and disable/reinstall them.

Other than that, I am pretty clueless on how you can fix this.

I usually use .pkg install GO and it works well.

  1. I try to use HomeBrew reinstall go, but it still doesn't work.
  2. I migrated from the old mac.Could it be an old system certificate issue?How can I reinstall the certificate?

@9M6
Copy link

9M6 commented Apr 1, 2021

  1. I migrated from the old mac.Could it be an old system certificate issue?How can I reinstall the certificate?
    Most likely.

Searching for the issue you have I found something related to Docker, but not sure if its going to work for your system.

x509 means you need to install ca-certificates, which usually happened when you want to visit https link:
sudo apt-get install -y ca-certificates

Reference to the solution.

@allbuleyu
Copy link
Author

  1. I migrated from the old mac.Could it be an old system certificate issue?How can I reinstall the certificate?
    Most likely.

Searching for the issue you have I found something related to Docker, but not sure if its going to work for your system.

x509 means you need to install ca-certificates, which usually happened when you want to visit https link:
sudo apt-get install -y ca-certificates

Reference to the solution.

I found a way to install ca-certificates using macos and it works.
mac os ca-certificates
Think you very much.

@yeyuqiu
Copy link

yeyuqiu commented Apr 14, 2021

  1. I migrated from the old mac.Could it be an old system certificate issue?How can I reinstall the certificate?
    Most likely.

Searching for the issue you have I found something related to Docker, but not sure if its going to work for your system.

x509 means you need to install ca-certificates, which usually happened when you want to visit https link:
sudo apt-get install -y ca-certificates

Reference to the solution.

I found a way to install ca-certificates using macos and it works.
mac os ca-certificates
Think you very much.

It does works.

@golang golang locked and limited conversation to collaborators Apr 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants