I'm having trouble accessing https
urls with the net/http
package.
Here's a working example of the error:
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 yields the error,
Get https://api.bitfinex.com/v1/book/ltcbtc: crypto/rsa: verification error
The docs for net/http
clearly state,
Get, Head, Post, and PostForm make HTTP (or HTTPS) requests
but I can't find any documentation on this error.
The source for crypto/rsa
only has this to say about the 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 pretty sure it's not their fault because Chrome is happy with their https certificate.
I've also tried using a Client
with a tls.Config
that has InsecureSkipVerify
set to true
, but that didn't seem to shut this error up.
Go uses the system root SSL certificate under linux and windows.
Given that the test works fine on my ubuntu 12.04 box with go 1.2, either
If you want to update your root certificates, here is a hint for windows. Googling should find you more ideas for other OSes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With