Fix example and use ClientCAs.

Server trust client certificates using ClientCAs instead of RootCAs.
This commit is contained in:
Mariano Cano 2020-09-02 15:08:24 -07:00
parent 54e43604ff
commit 50d09c183b

View file

@ -34,7 +34,7 @@ func main() {
w.Write([]byte(fmt.Sprintf("Hello %s (cert issued by '%s') at %s", name, issuer, time.Now().UTC()))) w.Write([]byte(fmt.Sprintf("Hello %s (cert issued by '%s') at %s", name, issuer, time.Now().UTC())))
}), }),
}, ca.AddFederationToRootCAs(), ListTrustedRoots()) }, ca.AddFederationToClientCAs(), ListTrustedRoots())
if err != nil { if err != nil {
panic(err) panic(err)
} }