acme-client 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -1
- data/lib/acme/client.rb +8 -1
- data/lib/acme/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54ec1f6479ae9ad3e2cbf8c5986a10c320f357c8
|
4
|
+
data.tar.gz: df0f59c9c338dc51dc695be84a463af71c839476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8f1abedad59da56d0703c142db46c87467cda2fe7612c638f83ca9a6b77029b783d8eea8231b04c99094495b70164efda1ca03be08be28eb70cb5ca20b15de2
|
7
|
+
data.tar.gz: e6913ac5eda13275adcd2638e04d96c23a6c13083dc4e70c7956236e03a1d7d4aca22c2f388c6fc4917987dfb42ca828c27d605f2cb856ed3117e73d2b25e21d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -182,7 +182,10 @@ Certificate generation happens asynchronously. You may need to poll.
|
|
182
182
|
```ruby
|
183
183
|
csr = Acme::Client::CertificateRequest.new(private_key: a_different_private_key, subject: { common_name: 'example.com' })
|
184
184
|
order.finalize(csr: csr)
|
185
|
-
|
185
|
+
while order.status == 'processing'
|
186
|
+
sleep(1)
|
187
|
+
challenge.reload
|
188
|
+
end
|
186
189
|
order.certificate # => PEM-formatted certificate
|
187
190
|
```
|
188
191
|
|
data/lib/acme/client.rb
CHANGED
@@ -29,7 +29,7 @@ class Acme::Client
|
|
29
29
|
pem: 'application/pem-certificate-chain'
|
30
30
|
}
|
31
31
|
|
32
|
-
def initialize(jwk: nil, kid: nil, private_key: nil, directory: DEFAULT_DIRECTORY, connection_options: {})
|
32
|
+
def initialize(jwk: nil, kid: nil, private_key: nil, directory: DEFAULT_DIRECTORY, connection_options: {}, bad_nonce_retry: 0)
|
33
33
|
if jwk.nil? && private_key.nil?
|
34
34
|
raise ArgumentError, 'must specify jwk or private_key'
|
35
35
|
end
|
@@ -41,6 +41,7 @@ class Acme::Client
|
|
41
41
|
end
|
42
42
|
|
43
43
|
@kid, @connection_options = kid, connection_options
|
44
|
+
@bad_nonce_retry = bad_nonce_retry
|
44
45
|
@directory = Acme::Client::Resources::Directory.new(URI(directory), @connection_options)
|
45
46
|
@nonces ||= []
|
46
47
|
end
|
@@ -280,6 +281,12 @@ class Acme::Client
|
|
280
281
|
|
281
282
|
def new_connection(endpoint:)
|
282
283
|
Faraday.new(endpoint, **@connection_options) do |configuration|
|
284
|
+
if @bad_nonce_retry > 0
|
285
|
+
configuration.request(:retry,
|
286
|
+
max: @bad_nonce_retry,
|
287
|
+
methods: Faraday::Connection::METHODS,
|
288
|
+
exceptions: [Acme::Client::Error::BadNonce])
|
289
|
+
end
|
283
290
|
yield(configuration) if block_given?
|
284
291
|
configuration.adapter Faraday.default_adapter
|
285
292
|
end
|
data/lib/acme/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acme-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Barbier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|