acme_nsupdate 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acme_nsupdate/client.rb +15 -3
- data/lib/acme_nsupdate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e1b004d46a0db137ee5f6192a1cb15d390126ae015e1fe0bf63b07521728e1a
|
4
|
+
data.tar.gz: ef1eace7977e874bd2eab6b88684c43757a1836f35f396d29eaa2098f98ca82c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2426cb0c59ff70854843bdd5d120770c1b3f7fdbdc76b7433bc998c63e3c704d54238d720953696a10a9fa49503eb41254fac9ddf7a4b5003206be40bf89e937
|
7
|
+
data.tar.gz: cdad307cd058a0ff61a9f180bfff1b74e4ea0598a6f75e91f151e2f260634ed4cf393d63d9b2362da43c83323cb40ad4cb85d37fad211f81bd30c558163d3e54
|
data/lib/acme_nsupdate/client.rb
CHANGED
@@ -14,6 +14,18 @@ module AcmeNsupdate
|
|
14
14
|
class Error < RuntimeError
|
15
15
|
end
|
16
16
|
|
17
|
+
class DebuggableClient < Acme::Client
|
18
|
+
attr_accessor :logger
|
19
|
+
|
20
|
+
def new_connection endpoint:
|
21
|
+
super do |configuration|
|
22
|
+
yield(configuration) if block_given?
|
23
|
+
configuration.response :detailed_logger, @logger if @logger
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
17
29
|
RENEWAL_THRESHOLD = 2_592_000 # 30*24*60*60, 30 days
|
18
30
|
|
19
31
|
attr_reader :options, :logger
|
@@ -53,8 +65,8 @@ module AcmeNsupdate
|
|
53
65
|
end
|
54
66
|
|
55
67
|
def client
|
56
|
-
@client ||=
|
57
|
-
client.
|
68
|
+
@client ||= DebuggableClient.new(private_key: account_key, directory: @options[:endpoint]).tap do |client|
|
69
|
+
client.logger = @logger if @options[:verbose]
|
58
70
|
end
|
59
71
|
end
|
60
72
|
|
@@ -94,7 +106,7 @@ module AcmeNsupdate
|
|
94
106
|
end
|
95
107
|
|
96
108
|
def fetch_certificate order
|
97
|
-
order.finalize csr
|
109
|
+
order.finalize csr: csr
|
98
110
|
while order.status == 'processing'
|
99
111
|
sleep 3
|
100
112
|
order.reload
|