import ( "crypto/tls" "crypto/x509" "io/ioutil" ) func main() { certFile, err := ioutil.ReadFile("server.pem") if err != nil { panic(err) } certPool := x509.NewCertPool() certPool.AppendCertsFromPEM(certFile) config := &tls.Config{ RootCAs: certPool, } // use config in tls.Dial or tls.Listen }In this example, we read the certificate file "server.pem" and add it to a new certificate pool using the `x509.NewCertPool()` and `certPool.AppendCertsFromPEM()` functions. We then set this certificate pool as the trusted root CAs for the TLS configuration. The crypto.tls package is a standard Go package, part of the Go standard library.