@@ -38,38 +38,18 @@ func init() {
3838
3939// OnDemandConfig configures on-demand TLS, for obtaining
4040// needed certificates at handshake-time. Because this
41- // feature can easily be abused, you should use this to
42- // establish rate limits and/or an internal endpoint that
43- // Caddy can "ask" if it should be allowed to manage
44- // certificates for a given hostname.
41+ // feature can easily be abused, Caddy must ask permission
42+ // to your application whether a particular domain is allowed
43+ // to have a certificate issued for it.
4544type OnDemandConfig struct {
46- // DEPRECATED. WILL BE REMOVED SOON. Use 'permission' instead.
45+ // DEPRECATED. WILL BE REMOVED SOON. Use 'permission' instead with the `http` module .
4746 Ask string `json:"ask,omitempty"`
4847
4948 // REQUIRED. A module that will determine whether a
5049 // certificate is allowed to be loaded from storage
5150 // or obtained from an issuer on demand.
5251 PermissionRaw json.RawMessage `json:"permission,omitempty" caddy:"namespace=tls.permission inline_key=module"`
5352 permission OnDemandPermission
54-
55- // DEPRECATED. An optional rate limit to throttle
56- // the checking of storage and the issuance of
57- // certificates from handshakes if not already in
58- // storage. WILL BE REMOVED IN A FUTURE RELEASE.
59- RateLimit * RateLimit `json:"rate_limit,omitempty"`
60- }
61-
62- // DEPRECATED. WILL LIKELY BE REMOVED SOON.
63- // Instead of using this rate limiter, use a proper tool such as a
64- // level 3 or 4 firewall and/or a permission module to apply rate limits.
65- type RateLimit struct {
66- // A duration value. Storage may be checked and a certificate may be
67- // obtained 'burst' times during this interval.
68- Interval caddy.Duration `json:"interval,omitempty"`
69-
70- // How many times during an interval storage can be checked or a
71- // certificate can be obtained.
72- Burst int `json:"burst,omitempty"`
7353}
7454
7555// OnDemandPermission is a type that can give permission for
@@ -195,8 +175,7 @@ var ErrPermissionDenied = errors.New("certificate not allowed by permission modu
195175
196176// These perpetual values are used for on-demand TLS.
197177var (
198- onDemandRateLimiter = certmagic .NewRateLimiter (0 , 0 )
199- onDemandAskClient = & http.Client {
178+ onDemandAskClient = & http.Client {
200179 Timeout : 10 * time .Second ,
201180 CheckRedirect : func (req * http.Request , via []* http.Request ) error {
202181 return fmt .Errorf ("following http redirects is not allowed" )
0 commit comments