0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/config/setup/tls.go

22 lines
343 B
Go
Raw Normal View History

package setup
import "github.com/mholt/caddy/middleware"
func TLS(c *Controller) (middleware.Middleware, error) {
2015-05-05 00:26:28 -05:00
c.TLS.Enabled = c.Port != "http"
for c.Next() {
if !c.NextArg() {
return nil, c.ArgErr()
}
c.TLS.Certificate = c.Val()
if !c.NextArg() {
return nil, c.ArgErr()
}
c.TLS.Key = c.Val()
}
return nil, nil
}