Reputation: 71
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?
Upvotes: 0
Views: 170
Reputation: 387
This should give you enough to start Googling and sourcing your solution.
Upvotes: 1