Commit dd91812b authored by Matthew Holt's avatar Matthew Holt

Merge branch 'configfix' into letsencrypt

parents 0a1e472f 10619f06
...@@ -2,6 +2,7 @@ package setup ...@@ -2,6 +2,7 @@ package setup
import ( import (
"crypto/tls" "crypto/tls"
"log"
"strings" "strings"
"github.com/mholt/caddy/middleware" "github.com/mholt/caddy/middleware"
...@@ -12,6 +13,12 @@ func TLS(c *Controller) (middleware.Middleware, error) { ...@@ -12,6 +13,12 @@ func TLS(c *Controller) (middleware.Middleware, error) {
c.TLS.Enabled = true c.TLS.Enabled = true
} }
if c.Port == "http" {
c.TLS.Enabled = false
log.Printf("Warning: TLS disabled for %s://%s. To force TLS over the plaintext HTTP port, "+
"specify port 80 explicitly (https://%s:80).", c.Port, c.Host, c.Host)
}
for c.Next() { for c.Next() {
args := c.RemainingArgs() args := c.RemainingArgs()
switch len(args) { switch len(args) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment