Class: LetsencryptStandalone::Client
- Defined in:
- lib/letsencrypt_standalone/client.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#acme_client ⇒ Object
readonly
Returns the value of attribute acme_client.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
- #authorize(domain:) ⇒ Object
- #create(email) ⇒ Object
-
#initialize(account: nil, email:) ⇒ Client
constructor
A new instance of Client.
Methods inherited from Base
#endpoint_url, #logger, logger, #output_dir, #path, #ssl_subdir
Constructor Details
#initialize(account: nil, email:) ⇒ Client
Returns a new instance of Client.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/letsencrypt_standalone/client.rb', line 9 def initialize(account: nil, email:) @email = email @account = account @acme_client = Acme::Client.new(private_key: private_key, endpoint: endpoint_url) if !account logger.info "Account key not found. Creating..." @account = 'account.pem' create(email) save_account_key raise 'No email specified' if !email end end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
7 8 9 |
# File 'lib/letsencrypt_standalone/client.rb', line 7 def account @account end |
#acme_client ⇒ Object (readonly)
Returns the value of attribute acme_client.
7 8 9 |
# File 'lib/letsencrypt_standalone/client.rb', line 7 def acme_client @acme_client end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
7 8 9 |
# File 'lib/letsencrypt_standalone/client.rb', line 7 def email @email end |
Instance Method Details
#authorize(domain:) ⇒ Object
28 29 30 |
# File 'lib/letsencrypt_standalone/client.rb', line 28 def (domain:) @acme_client.(domain: domain) end |
#create(email) ⇒ Object
23 24 25 26 |
# File 'lib/letsencrypt_standalone/client.rb', line 23 def create(email) contact = 'mailto:' + email #https://github.com/schubergphilis/letsencrypt/issues/3 @acme_client.register(contact: contact).agree_terms end |