mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-25 09:23:45 +08:00
core: Disable TLS for http sites (again)
Fixes bug introduced in 0ac8bf5
- Also note that setup functions no longer have access to server port. Will need to fix later.
This commit is contained in:
parent
afd6b7ea27
commit
7796ff0f69
|
@ -57,6 +57,11 @@ func Load(filename string, input io.Reader) (Group, error) {
|
|||
if config.Port == "" {
|
||||
config.Port = Port
|
||||
}
|
||||
if config.Port == "http" {
|
||||
config.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).", config.Port, config.Host, config.Host)
|
||||
}
|
||||
if i == 0 {
|
||||
sharedConfig.Startup = []func() error{}
|
||||
sharedConfig.Shutdown = []func() error{}
|
||||
|
|
|
@ -31,7 +31,7 @@ func FastCGI(c *Controller) (middleware.Middleware, error) {
|
|||
SoftwareName: c.AppName,
|
||||
SoftwareVersion: c.AppVersion,
|
||||
ServerName: c.Host,
|
||||
ServerPort: c.Port,
|
||||
ServerPort: c.Port, // BUG: This is not known until the server blocks are split up...
|
||||
}
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package setup
|
|||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/mholt/caddy/middleware"
|
||||
|
@ -10,11 +9,6 @@ import (
|
|||
|
||||
func TLS(c *Controller) (middleware.Middleware, error) {
|
||||
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() {
|
||||
if !c.NextArg() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user