Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 01:45 UTC
caddytls: Clarify some JSON config docs
Matthew Holt committed
Jun 4, 2023 at 22:15 UTC
4ba03c9d38aae134bd8616178315086589b69ba8
2 files changed
+19
-3
modules/caddytls/automation.go
+7
@@ -85,6 +85,13 @@ type AutomationConfig struct {
85
// TLS app to properly provision a new policy.
86
type AutomationPolicy struct {
87
// Which subjects (hostnames or IP addresses) this policy applies to.
88
+ //
89
+ // This list is a filter, not a command. In other words, it is used
90
+ // only to filter whether this policy should apply to a subject that
91
+ // needs a certificate; it does NOT command the TLS app to manage a
92
+ // certificate for that subject. To have Caddy automate a certificate
93
+ // or specific subjects, use the "automate" certificate loader module
94
+ // of the TLS app.
95
SubjectsRaw []string `json:"subjects,omitempty"`
96
97
// The modules that may issue certificates. Default: internal if all
modules/caddytls/tls.go
+12
-3
@@ -39,9 +39,16 @@ func init() {
39
// TLS provides TLS facilities including certificate
40
// loading and management, client auth, and more.
41
type TLS struct {
42
- // Caches certificates in memory for quick use during
42
+ // Certificates to load into memory for quick recall during
43
// TLS handshakes. Each key is the name of a certificate
44
- // loader module. All loaded certificates get pooled
44
+ // loader module.
45
+ //
46
+ // The "automate" certificate loader module can be used to
47
+ // specify a list of subjects that need certificates to be
48
+ // managed automatically. The first matching automation
49
+ // policy will be applied to manage the certificate(s).
50
+ //
51
+ // All loaded certificates get pooled
52
// into the same cache and may be used to complete TLS
53
// handshakes for the relevant server names (SNI).
54
// Certificates loaded manually (anything other than
@@ -557,7 +564,9 @@ type Certificate struct {
564
//
565
// Technically, this is a no-op certificate loader module that is treated as
566
// a special case: it uses this app's automation features to load certificates
560
-// for the list of hostnames, rather than loading certificates manually.
567
+// for the list of hostnames, rather than loading certificates manually. But
568
+// the end result is the same: certificates for these subject names will be
569
+// loaded into the in-memory cache and may then be used.
570
type AutomateLoader []string
571
572
// CaddyModule returns the Caddy module information.