0

I have two rails apps running on different ports. From one app I am trying to consume the API of the other app. Here's the code for Product.rb model in APP_1.

class Product < ActiveResource::Base
  self.site = "https://localhost:3000"
  self.ssl_options = {:cert         => OpenSSL::X509::Certificate.new(File.open(pem_file)),
                      :key          => OpenSSL::PKey::RSA.new(File.open(pem_file)),
                      :ca_path      => "/path/to/OpenSSL/formatted/CA_Certs",
                      :verify_mode  => OpenSSL::SSL::VERIFY_PEER}
end

I have a controller and routes set for Product model. When I run APP_1 i get

 undefined local variable or method `pem_file' for Product:Class

Can anyone tell me about how to write a pem file, what is a pem file?

user2122528
  • 71
  • 1
  • 4

1 Answers1

1

Check out: https://serverfault.com/questions/9708/what-is-a-pem-file-and-how-does-it-differ-from-other-openssl-generated-key-file

This should give you enough to start Googling and sourcing your solution.

Community
  • 1
  • 1
BenjiBoyWick
  • 387
  • 1
  • 8