mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-09 04:18:50 +03:00
22 lines
331 B
Go
22 lines
331 B
Go
|
package setup
|
||
|
|
||
|
import "github.com/mholt/caddy/middleware"
|
||
|
|
||
|
func TLS(c *Controller) (middleware.Middleware, error) {
|
||
|
c.TLS.Enabled = true
|
||
|
|
||
|
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
|
||
|
}
|