Browse Source

httpcaddyfile: Adjust iterator when removing AP (fix #3953)

master
Matthew Holt 4 years ago
parent
commit
7846bc1e06
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 1
      caddyconfig/httpcaddyfile/tlsapp.go
  2. 0
      caddytest/integration/caddyfile_adapt/tls_automation_policies_1.txt
  3. 96
      caddytest/integration/caddyfile_adapt/tls_automation_policies_2.txt

1
caddyconfig/httpcaddyfile/tlsapp.go

@ -518,6 +518,7 @@ func consolidateAutomationPolicies(aps []*caddytls.AutomationPolicy) []*caddytls
// '*.com', which might be different (yes we've seen this happen)
if automationPolicyShadows(i, aps) >= j {
aps = append(aps[:i], aps[i+1:]...)
i--
}
} else {
// avoid repeated subjects

0
caddytest/integration/caddyfile_adapt/tls_automation_policies.txt → caddytest/integration/caddyfile_adapt/tls_automation_policies_1.txt

96
caddytest/integration/caddyfile_adapt/tls_automation_policies_2.txt

@ -0,0 +1,96 @@
# issue #3953
{
cert_issuer zerossl api_key
}
example.com {
tls {
on_demand
}
}
http://example.net {
}
:1234 {
}
----------
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":1234"
]
},
"srv1": {
"listen": [
":443"
],
"routes": [
{
"match": [
{
"host": [
"example.com"
]
}
],
"terminal": true
}
]
},
"srv2": {
"listen": [
":80"
],
"routes": [
{
"match": [
{
"host": [
"example.net"
]
}
],
"terminal": true
}
],
"automatic_https": {
"skip": [
"example.net"
]
}
}
}
},
"tls": {
"automation": {
"policies": [
{
"subjects": [
"example.com"
],
"issuers": [
{
"api_key": "api_key",
"module": "zerossl"
}
],
"on_demand": true
},
{
"issuers": [
{
"api_key": "api_key",
"module": "zerossl"
}
]
}
]
}
}
}
}
Loading…
Cancel
Save