mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-02 22:04:07 +08:00
b3d35a4995
If an email is specified in global options, a site called 'localhost' shouldn't be bunched together with public DNS names in the automation policies, which get the default, public-CA issuers. Fix old test that did this. I also noticed that these two: localhost { } example.com { } and localhost, example.com { } produce slightly different TLS automation policies. The former is what the new test case covers, and we have logic that removes the empty automation policy for localhost so that auto-HTTPS can implicitly create one. (We prefer that whenever possible.) But the latter case produces two automation policies, with the second one being for localhost, with an explicit internal issuer. It's not wrong, just more explicit than it needs to be. I'd really like to completely rewrite the code from scratch that generates automation policies, hopefully there is a simpler, more correct algorithm.
57 lines
713 B
Plaintext
57 lines
713 B
Plaintext
{
|
|
preferred_chains smallest
|
|
}
|
|
|
|
example.com
|
|
----------
|
|
{
|
|
"apps": {
|
|
"http": {
|
|
"servers": {
|
|
"srv0": {
|
|
"listen": [
|
|
":443"
|
|
],
|
|
"routes": [
|
|
{
|
|
"match": [
|
|
{
|
|
"host": [
|
|
"example.com"
|
|
]
|
|
}
|
|
],
|
|
"terminal": true
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"tls": {
|
|
"automation": {
|
|
"policies": [
|
|
{
|
|
"subjects": [
|
|
"example.com"
|
|
],
|
|
"issuers": [
|
|
{
|
|
"module": "acme",
|
|
"preferred_chains": {
|
|
"smallest": true
|
|
}
|
|
},
|
|
{
|
|
"module": "zerossl",
|
|
"preferred_chains": {
|
|
"smallest": true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|