1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

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

This commit is contained in:
Francis Lavoie 2023-10-14 16:23:50 -04:00 committed by Matthew Holt
parent 979c413f04
commit ec2de22ab1
2 changed files with 68 additions and 0 deletions

View file

@ -582,6 +582,7 @@ outer:
// eaten up by the one with subjects; and if both have subjects, we // eaten up by the one with subjects; and if both have subjects, we
// need to combine their lists // need to combine their lists
if reflect.DeepEqual(aps[i].IssuersRaw, aps[j].IssuersRaw) && if reflect.DeepEqual(aps[i].IssuersRaw, aps[j].IssuersRaw) &&
reflect.DeepEqual(aps[i].ManagersRaw, aps[j].ManagersRaw) &&
bytes.Equal(aps[i].StorageRaw, aps[j].StorageRaw) && bytes.Equal(aps[i].StorageRaw, aps[j].StorageRaw) &&
aps[i].MustStaple == aps[j].MustStaple && aps[i].MustStaple == aps[j].MustStaple &&
aps[i].KeyType == aps[j].KeyType && aps[i].KeyType == aps[j].KeyType &&

View file

@ -0,0 +1,67 @@
# example from https://caddy.community/t/21415
a.com {
tls {
get_certificate http http://foo.com/get
}
}
b.com {
}
----------
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"match": [
{
"host": [
"a.com"
]
}
],
"terminal": true
},
{
"match": [
{
"host": [
"b.com"
]
}
],
"terminal": true
}
]
}
}
},
"tls": {
"automation": {
"policies": [
{
"subjects": [
"a.com"
],
"get_certificate": [
{
"url": "http://foo.com/get",
"via": "http"
}
]
},
{
"subjects": [
"b.com"
]
}
]
}
}
}
}