INNER CODE UNIT · Go
main
wso2/product-microgateway · samples/interceptors/golang/go-interceptor-server-generated/main.go:21
func main() {
router := sw.NewRouter()
// load CA certificate file and add it to list of client CAs
caCertFile, err := ioutil.ReadFile("./certs/mg.pem")
if err != nil {
log.Fatalf("error reading CA certificate: %v", err)
}
certPool := x509.NewCertPool()
certPool.AppendCertsFromPEM(caCertFile)
// serve on port 9090 of local host
server := http.Server{
Addr: ":9081",
Handler: router,
TLSConfig: &tls.Config{
ClientAuth: tls.RequireAndVerifyClientCert,
ClientCAs: certPool,
MinVersion: tls.VersionTLS11,