systemtruststores / systemtruststores.github.io

Website
0 stars 0 forks source link

Language support: Go #3

Open chriskilding opened 2 years ago

chriskilding commented 2 years ago

Tracking support for native TLS certificate verification in Go (Golang).

chriskilding commented 2 years ago

My own testing with the following Go 'hello world' HTTPS program, run behind an HTTPS proxy, shows that TLS verification via the Keychain 'just works' with any recent Go version:

package main

import (
    "fmt"
    "net/http"
)

func main() {
    resp, _ = http.Get("https://www.example.com")

    if resp.StatusCode >= 200 {
        fmt.Println("Success")
    }
}

I.e. demonstrating that Go can utilise the TLS root certificates in the OS trust store.

I have not been able to track down the commit or PR that first added support for this, but there have been several improvements to the feature over time such as:

So Go has clearly supported this for a long time.