Fix typo.

This commit is contained in:
Mariano Cano 2019-02-05 17:33:16 -08:00
parent 3c06d6f9bc
commit 975cb75fbd
2 changed files with 8 additions and 8 deletions

View file

@ -76,15 +76,15 @@ func (c *mutableTLSConfig) Reload() {
c.Unlock() c.Unlock()
} }
// AddFixedClientCACert add an in-mutable cert to ClientCAs. // AddImmutableClientCACert add an in-mutable cert to ClientCAs.
func (c *mutableTLSConfig) AddInmutableClientCACert(cert *x509.Certificate) { func (c *mutableTLSConfig) AddImmutableClientCACert(cert *x509.Certificate) {
c.Lock() c.Lock()
c.clientCerts = append(c.clientCerts, cert) c.clientCerts = append(c.clientCerts, cert)
c.Unlock() c.Unlock()
} }
// AddInmutableRootCACert add an in-mutable cert to RootCas. // AddImmutableRootCACert add an in-mutable cert to RootCas.
func (c *mutableTLSConfig) AddInmutableRootCACert(cert *x509.Certificate) { func (c *mutableTLSConfig) AddImmutableRootCACert(cert *x509.Certificate) {
c.Lock() c.Lock()
c.rootCerts = append(c.rootCerts, cert) c.rootCerts = append(c.rootCerts, cert)
c.Unlock() c.Unlock()

View file

@ -48,7 +48,7 @@ func (ctx *TLSOptionCtx) apply(options []TLSOption) error {
ctx.Config.RootCAs = x509.NewCertPool() ctx.Config.RootCAs = x509.NewCertPool()
} }
ctx.Config.RootCAs.AddCert(root) ctx.Config.RootCAs.AddCert(root)
ctx.mutableConfig.AddInmutableRootCACert(root) ctx.mutableConfig.AddImmutableRootCACert(root)
} }
if !ctx.hasClientCA && ctx.Config.ClientAuth != tls.NoClientCert { if !ctx.hasClientCA && ctx.Config.ClientAuth != tls.NoClientCert {
@ -56,7 +56,7 @@ func (ctx *TLSOptionCtx) apply(options []TLSOption) error {
ctx.Config.ClientCAs = x509.NewCertPool() ctx.Config.ClientCAs = x509.NewCertPool()
} }
ctx.Config.ClientCAs.AddCert(root) ctx.Config.ClientCAs.AddCert(root)
ctx.mutableConfig.AddInmutableClientCACert(root) ctx.mutableConfig.AddImmutableClientCACert(root)
} }
} }
@ -116,7 +116,7 @@ func AddRootCA(cert *x509.Certificate) TLSOption {
ctx.Config.RootCAs = x509.NewCertPool() ctx.Config.RootCAs = x509.NewCertPool()
} }
ctx.Config.RootCAs.AddCert(cert) ctx.Config.RootCAs.AddCert(cert)
ctx.mutableConfig.AddInmutableRootCACert(cert) ctx.mutableConfig.AddImmutableRootCACert(cert)
return nil return nil
} }
} }
@ -130,7 +130,7 @@ func AddClientCA(cert *x509.Certificate) TLSOption {
ctx.Config.ClientCAs = x509.NewCertPool() ctx.Config.ClientCAs = x509.NewCertPool()
} }
ctx.Config.ClientCAs.AddCert(cert) ctx.Config.ClientCAs.AddCert(cert)
ctx.mutableConfig.AddInmutableClientCACert(cert) ctx.mutableConfig.AddImmutableClientCACert(cert)
return nil return nil
} }
} }