@@ -38,38 +38,18 @@ func init() {
38
38
39
39
// OnDemandConfig configures on-demand TLS, for obtaining
40
40
// 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.
45
44
type OnDemandConfig struct {
46
- // DEPRECATED. WILL BE REMOVED SOON. Use 'permission' instead.
45
+ // DEPRECATED. WILL BE REMOVED SOON. Use 'permission' instead with the `http` module .
47
46
Ask string `json:"ask,omitempty"`
48
47
49
48
// REQUIRED. A module that will determine whether a
50
49
// certificate is allowed to be loaded from storage
51
50
// or obtained from an issuer on demand.
52
51
PermissionRaw json.RawMessage `json:"permission,omitempty" caddy:"namespace=tls.permission inline_key=module"`
53
52
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"`
73
53
}
74
54
75
55
// OnDemandPermission is a type that can give permission for
@@ -195,8 +175,7 @@ var ErrPermissionDenied = errors.New("certificate not allowed by permission modu
195
175
196
176
// These perpetual values are used for on-demand TLS.
197
177
var (
198
- onDemandRateLimiter = certmagic .NewRateLimiter (0 , 0 )
199
- onDemandAskClient = & http.Client {
178
+ onDemandAskClient = & http.Client {
200
179
Timeout : 10 * time .Second ,
201
180
CheckRedirect : func (req * http.Request , via []* http.Request ) error {
202
181
return fmt .Errorf ("following http redirects is not allowed" )
0 commit comments