@marcel91200 / caddy Mirror · read-only / commits / 7984e6f6
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 22:00 UTC

httpcaddyfile: Fix TLS automation policy merging with get_certificate (#5896)

Francis Lavoie committed Oct 14, 2023 at 16:23 UTC 7984e6f6fd235b033adb933b2030b9ba9bc66eeb
2 files changed +68
caddyconfig/httpcaddyfile/tlsapp.go
+1
@@ -582,6 +582,7 @@ outer:
582 // eaten up by the one with subjects; and if both have subjects, we
583 // need to combine their lists
584 if reflect.DeepEqual(aps[i].IssuersRaw, aps[j].IssuersRaw) &&
585 + reflect.DeepEqual(aps[i].ManagersRaw, aps[j].ManagersRaw) &&
586 bytes.Equal(aps[i].StorageRaw, aps[j].StorageRaw) &&
587 aps[i].MustStaple == aps[j].MustStaple &&
588 aps[i].KeyType == aps[j].KeyType &&
caddytest/integration/caddyfile_adapt/tls_automation_policies_11.txt new
+67
@@ -0,0 +1,67 @@
1 +# example from https://caddy.community/t/21415
2 +a.com {
3 + tls {
4 + get_certificate http http://foo.com/get
5 + }
6 +}
7 +
8 +b.com {
9 +}
10 +----------
11 +{
12 + "apps": {
13 + "http": {
14 + "servers": {
15 + "srv0": {
16 + "listen": [
17 + ":443"
18 + ],
19 + "routes": [
20 + {
21 + "match": [
22 + {
23 + "host": [
24 + "a.com"
25 + ]
26 + }
27 + ],
28 + "terminal": true
29 + },
30 + {
31 + "match": [
32 + {
33 + "host": [
34 + "b.com"
35 + ]
36 + }
37 + ],
38 + "terminal": true
39 + }
40 + ]
41 + }
42 + }
43 + },
44 + "tls": {
45 + "automation": {
46 + "policies": [
47 + {
48 + "subjects": [
49 + "a.com"
50 + ],
51 + "get_certificate": [
52 + {
53 + "url": "http://foo.com/get",
54 + "via": "http"
55 + }
56 + ]
57 + },
58 + {
59 + "subjects": [
60 + "b.com"
61 + ]
62 + }
63 + ]
64 + }
65 + }
66 + }
67 +}
\ No newline at end of file