subjectQualifiesForPublicCert is like certmagic.SubjectQualifiesForPublicCert() except that this allows domains with multiple wildcard levels like '*.*.example.com' to qualify if the automation policy has OnDemand enabled (i.e. this function is more lenient). IP subjects are considered as non-quali
(ap *caddytls.AutomationPolicy, subj string)
| 1123 | // not qualifying for public certificates. Users should expressly configure an issuer |
| 1124 | // that supports IP certs for that purpose. |
| 1125 | func subjectQualifiesForPublicCert(ap *caddytls.AutomationPolicy, subj string) bool { |
| 1126 | return !certmagic.SubjectIsIP(subj) && |
| 1127 | !certmagic.SubjectIsInternal(subj) && |
| 1128 | (strings.Count(subj, "*.") < 2 || ap.OnDemand) |
| 1129 | } |
| 1130 | |
| 1131 | func automationPoliciesHaveSameIssuers(a, b *caddytls.AutomationPolicy) bool { |
| 1132 | if reflect.DeepEqual(a.IssuersRaw, b.IssuersRaw) { |
no outgoing calls
no test coverage detected