Top Level Namespace

Defined Under Namespace

Classes: App, Push, Token

Constant Summary collapse

LIBDIR =

Initilization Setup

File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
ROOTDIR =
File.expand_path(File.join(File.dirname(__FILE__), '..'))

Instance Method Summary collapse

Instance Method Details

#check_certObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/ass.rb', line 64

def check_cert
  $apps.each { |app|
    unless File.exist?("#{Dir.pwd}/#{app}_#{$mode}.pem") then
      puts "Please provide #{app}_#{$mode}.pem under '#{Dir.pwd}/' directory"
      return false;
    else
      puts "'#{app}'s #{$mode} PEM: (#{app}_#{$mode}.pem)"
      certfile = File.read("#{Dir.pwd}/#{app}_#{$mode}.pem")
      openSSLContext = OpenSSL::SSL::SSLContext.new
      openSSLContext.cert = OpenSSL::X509::Certificate.new(certfile)
      openSSLContext.key = OpenSSL::PKey::RSA.new(certfile)
      $certkey["#{app}"] = openSSLContext
    end
  }
  return true
end