mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-24 01:26:47 +01: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
3 changed files with 6 additions and 7 deletions
|
@ -57,6 +57,11 @@ func Load(filename string, input io.Reader) (Group, error) {
|
||||||
if config.Port == "" {
|
if config.Port == "" {
|
||||||
config.Port = 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 {
|
if i == 0 {
|
||||||
sharedConfig.Startup = []func() error{}
|
sharedConfig.Startup = []func() error{}
|
||||||
sharedConfig.Shutdown = []func() error{}
|
sharedConfig.Shutdown = []func() error{}
|
||||||
|
|
|
@ -31,7 +31,7 @@ func FastCGI(c *Controller) (middleware.Middleware, error) {
|
||||||
SoftwareName: c.AppName,
|
SoftwareName: c.AppName,
|
||||||
SoftwareVersion: c.AppVersion,
|
SoftwareVersion: c.AppVersion,
|
||||||
ServerName: c.Host,
|
ServerName: c.Host,
|
||||||
ServerPort: c.Port,
|
ServerPort: c.Port, // BUG: This is not known until the server blocks are split up...
|
||||||
}
|
}
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package setup
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"log"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mholt/caddy/middleware"
|
"github.com/mholt/caddy/middleware"
|
||||||
|
@ -10,11 +9,6 @@ import (
|
||||||
|
|
||||||
func TLS(c *Controller) (middleware.Middleware, error) {
|
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() {
|
||||||
if !c.NextArg() {
|
if !c.NextArg() {
|
||||||
|
|
Loading…
Reference in a new issue