Sha256: 8d2ec1a172cd7247eb2ceea774a62e9f61dafef48c48967fe6f38a67a575e2e3

Contents?: true

Size: 660 Bytes

Versions: 2

Compression:

Stored size: 660 Bytes

Contents

require 'pathname'
require 'cgi'

module SSLHelpers
  CERTS_DIR = Pathname(__FILE__).dirname.join('ssl_certs').to_s

  CONFIG = OpenStruct.new
  CONFIG.ca_cert     = File.join(CERTS_DIR, 'ca-cert.pem')
  CONFIG.ca_key      = File.join(CERTS_DIR, 'ca-key.pem')
  CONFIG.server_cert = File.join(CERTS_DIR, 'server-cert.pem')
  CONFIG.server_key  = File.join(CERTS_DIR, 'server-key.pem')
  CONFIG.client_cert = File.join(CERTS_DIR, 'client-cert.pem')
  CONFIG.client_key  = File.join(CERTS_DIR, 'client-key.pem')
  CONFIG.cipher      = 'AES128-SHA'

  def self.query(*keys)
    keys.map { |key| "ssl[#{key}]=#{CGI.escape(CONFIG.send(key))}" }.join('&')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sbf-data_objects-0.11.0 lib/data_objects/spec/lib/ssl.rb
sbf-data_objects-0.10.17 lib/data_objects/spec/lib/ssl.rb