Skip to content

Commit 7984e6f

Browse files
httpcaddyfile: Fix TLS automation policy merging with get_certificate (#5896)
1 parent d70608b commit 7984e6f

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

caddyconfig/httpcaddyfile/tlsapp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ outer:
582582
// eaten up by the one with subjects; and if both have subjects, we
583583
// need to combine their lists
584584
if reflect.DeepEqual(aps[i].IssuersRaw, aps[j].IssuersRaw) &&
585+
reflect.DeepEqual(aps[i].ManagersRaw, aps[j].ManagersRaw) &&
585586
bytes.Equal(aps[i].StorageRaw, aps[j].StorageRaw) &&
586587
aps[i].MustStaple == aps[j].MustStaple &&
587588
aps[i].KeyType == aps[j].KeyType &&
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

0 commit comments

Comments
 (0)