Golang: HTTPS request gives "crypto / rsa: validation error"

I'm having trouble accessing https urls with net/http package.

Here is a working error example:

 package main import ( "fmt" "net/http" ) func main() { _, err := http.Get("https://api.bitfinex.com/v1/book/ltcbtc") if err != nil { fmt.Println(err) } } 

This program gives an error,

 Get https://api.bitfinex.com/v1/book/ltcbtc: crypto/rsa: verification error 

docs for net/http clearly stated

Get, Head, Post and PostForm make HTTP requests (or HTTPS)

but I can not find documentation about this error.

the source for crypto/rsa only this says an error:

 // ErrVerification represents a failure to verify a signature. // It is deliberately vague to avoid adaptive attacks. var ErrVerification = errors.New("crypto/rsa: verification error") 

So I'm not sure where to go from here. I’m sure it’s not their fault, because Chrome is happy with its https certificate.

I also tried using Client with tls.Config , which has InsecureSkipVerify set to true , but this did not seem to close this error.

+6
source share
1 answer

Go uses the system root SSL certificate in linux and windows .

Given that the test works fine on my ubuntu 12.04 box with go 1.2, either

  • You are using a very old version of go
  • Your system has outdated root certificates

If you want to renew your root certificates, here is a window tip. Googling should find more ideas for other OSs.

+1
source

All Articles