3

I'm getting below error while downloading.

go get github.com/go-sql-driver/mysql: module github.com/go-sql-driver/mysql: Get "https://proxy.golang.org/github.com/go-sql-driver/mysql/@v/list": x509: certificate signed by unknown authority

Go version - 1.13/1.15(tried both) OS - Ubuntu 18 Tried update ca-certificates as well

Can anyone help me out?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
alok rai
  • 31
  • 4
  • I meant adding much much more information to your question: this is the point of my answer and my comments: there is *a lot* we did not know about your environment, which would help other readers. – VonC Feb 04 '21 at 08:34

1 Answers1

0

Check first the context in which this error pops up:

  • go version
  • execution environment (shell).

For instance, this error pops up during Docker build instance, where the Dockerfile uses an image without certificates installed, as in golang/go issue 35702.
Said Dockerfile would need:

RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Go version- go version go1.15.6 linux/amd64 I'm running this as a standalone application. – alok rai Feb 04 '21 at 08:19
  • @alokrai Then it seems the certificates are not installed on your OS. Which OS this is? Ubuntu? – VonC Feb 04 '21 at 08:19
  • Yes I'm using Ubuntu 18.04. If you're aware then can you let me know the steps for installing the certificates. Thanks!! – alok rai Feb 04 '21 at 08:22
  • @alokrai Try `sudo update-ca-certificates` – VonC Feb 04 '21 at 08:25
  • @alokrai are you running this in a corporate network, via a captive portal, or in some other situation where there is a third party man-in-the-middling your TLS connections? Can you check what `openssl s_client -connect github.com:443` returns? – VonC Feb 04 '21 at 08:27
  • Yes I'm using this in a corporate network. That Command returns below response: CONNECTED(00000003) depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert High Assurance EV Root CA verify return:1 depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHA2 High Assurance Server CA verify return:1 depth=0 C = US, ST = California, L = San Francisco, O = "GitHub, Inc.", CN = github.com verify return:1 --- Certificate chain 0 s:/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=Digi – alok rai Feb 04 '21 at 08:28
  • @alokrai OK. Can you add all that in your question (OS, go version, coprporate network, openssl answer)? – VonC Feb 04 '21 at 08:29