summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2015-11-18 18:41:01 -0700
committerMatthew Holt <[email protected]>2015-11-18 18:41:01 -0700
commit4d907d57fa149789de8485e9327dc0822e5ed89a (patch)
tree179bf4c8a44a67a4b0063dec01ea339484d6c7fd
parent24352e799aa7eff2044e7ae548e94a8c3ad812de (diff)
downloadcaddy-0.8-beta.4.tar.gz
caddy-0.8-beta.4.zip
Whoops, emergency bug fixv0.8-beta.4
Made a faulty assumption that virualhosts could share acme proxy handlers; turns out they can't without fumbling up the middleware configuration (middleware chains overlap and cross over into other virtualhosts)!
-rw-r--r--caddy/letsencrypt/letsencrypt.go20
-rw-r--r--dist/README.txt2
2 files changed, 12 insertions, 10 deletions
diff --git a/caddy/letsencrypt/letsencrypt.go b/caddy/letsencrypt/letsencrypt.go
index f3f9fde7a..16312bd6a 100644
--- a/caddy/letsencrypt/letsencrypt.go
+++ b/caddy/letsencrypt/letsencrypt.go
@@ -364,20 +364,22 @@ func autoConfigure(allConfigs []server.Config, cfgIndex int) []server.Config {
// To support renewals, we need handlers at ports 80 and 443,
// depending on the challenge type that is used to complete renewal.
- // Every proxy for this host can share the handler.
- handler := new(Handler)
- mid := func(next middleware.Handler) middleware.Handler {
- handler.Next = next
- return handler
- }
- acmeHandlers[cfg.Host] = handler
-
- // Handler needs to go in 80 and 443
for i, c := range allConfigs {
if c.Address() == cfg.Host+":80" ||
c.Address() == cfg.Host+":443" ||
c.Address() == cfg.Host+":http" ||
c.Address() == cfg.Host+":https" {
+
+ // Each virtualhost must have their own handlers, or the chaining gets messed up when middlewares are compiled!
+ handler := new(Handler)
+ mid := func(next middleware.Handler) middleware.Handler {
+ handler.Next = next
+ return handler
+ }
+ // TODO: Currently, acmeHandlers are not referenced, but we need to add a way to toggle
+ // their proxy functionality -- or maybe not. Gotta figure this out for sure.
+ acmeHandlers[c.Address()] = handler
+
allConfigs[i].Middleware["/"] = append(allConfigs[i].Middleware["/"], mid)
}
}
diff --git a/dist/README.txt b/dist/README.txt
index 425f7bc45..0fd9d1a03 100644
--- a/dist/README.txt
+++ b/dist/README.txt
@@ -1,4 +1,4 @@
-CADDY 0.8 beta 3
+CADDY 0.8 beta 4
Website
https://caddyserver.com