Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCertPool ¶
Example (Http) ¶
package main
import (
"crypto/tls"
"fmt"
"io"
"net/http"
"github.com/buglloc/certifi"
)
func main() {
httpc := http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: certifi.NewCertPool(),
},
},
}
resp, err := httpc.Get("https://google.com/")
if err != nil {
panic(fmt.Sprintf("http failed: %v\n", err))
}
_, _ = io.Copy(io.Discard, resp.Body)
_ = resp.Body.Close()
fmt.Printf("successful, status code: %d\n", resp.StatusCode)
}
func ParseCertificates ¶ added in v0.9.5
func ParseCertificates(in []byte) ([]*x509.Certificate, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.