Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion acme-cli.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_runtime_dependency 'acme-client', '>= 2.0.0'
# keep faraday < 1.0.0 to support older ruby
spec.add_runtime_dependency 'faraday', '< 1.0.0'

spec.add_runtime_dependency 'acme-client', '>= 2.0.7'
spec.add_runtime_dependency 'thor'
spec.add_runtime_dependency 'colorize'

Expand Down
35 changes: 0 additions & 35 deletions letsencrypt-cli.gemspec

This file was deleted.

17 changes: 13 additions & 4 deletions lib/letsencrypt/cli/acme_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
require 'colorize'
require_relative 'support/certificate'

# fix Acme::Client::ChainIdentifier at least 2.0.9
class Acme::Client
class ChainIdentifier
def match_name?(name)
issuers.last.include?("/CN=#{name}") if issuers.any?
end
end
end

class AcmeWrapper
def initialize(options)
@options = options
Expand All @@ -23,7 +32,7 @@ def log(message, severity=:info)
end

def client
@client ||= Acme::Client.new(private_key: account_key, directory: directory)
@client ||= Acme::Client.new(private_key: account_key, directory: directory, connection_options: { ssl: { verify: @options[:ssl_verify] } })
end

def create_order(domains)
Expand All @@ -43,9 +52,9 @@ def authorize(authorization)

challenge.request_validation

10.times do
30.times do
log "Checking verification...", :debug
sleep 1
sleep 2
challenge.reload
break if challenge.status != 'pending'
end
Expand Down Expand Up @@ -97,7 +106,7 @@ def cert(domains)
sleep(1)
order.reload
end
certificate = Certificate.new(order.certificate)
certificate = Certificate.new(order.certificate(force_chain: @options[:chain]))
File.write(@options[:fullchain_path], certificate.fullchain_to_pem)
File.write(@options[:chain_path], certificate.chain_to_pem)
File.write(@options[:certificate_path], certificate.to_pem)
Expand Down
4 changes: 3 additions & 1 deletion lib/letsencrypt/cli/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class App < Thor
class_option :test, desc: "Use staging url of Letsencrypt instead of production server", aliases: "-t", type: :boolean
class_option :log_level, desc: "Log Level (debug, info, warn, error, fatal)", default: "info"
class_option :color, desc: "Disable colorize", default: true, type: :boolean

class_option :ssl_verify, desc: "OpenSSL verify", default: true, type: :boolean
class_option :chain, desc: "Certificate chain", default: 'ISRG Root X1'

desc 'register EMAIL', 'Register account'
method_option :key_length, desc: "Length of generated private key", type: :numeric, default: 4096
def register(email)
Expand Down
2 changes: 1 addition & 1 deletion lib/letsencrypt/cli/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Letsencrypt
module Cli
VERSION = "2.0.0"
VERSION = "2.0.1"
end
end