Class: LetsEncrypt::Redis

Inherits:
Object
  • Object
show all
Defined in:
lib/letsencrypt/redis.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.connectionObject



7
8
9
# File 'lib/letsencrypt/redis.rb', line 7

def connection
  @connection ||= ::Redis.new(url: LetsEncrypt.config.redis_url)
end

.save(cert) ⇒ Object

Save certificate into redis.



12
13
14
15
16
17
# File 'lib/letsencrypt/redis.rb', line 12

def save(cert)
  return unless cert.key.present? && cert.certificate.present?
  LetsEncrypt.logger.info "Save #{cert.domain}'s certificate to redis"
  connection.set "#{cert.domain}.key", cert.key
  connection.set "#{cert.domain}.crt", cert.certificate
end