whichdigital / active-rest-client

ActiveRestClient API Client
https://rubygems.org/gems/active_rest_client
MIT License
386 stars 44 forks source link

Unable to access site without SSL cert #106

Open klancaster opened 9 years ago

klancaster commented 9 years ago

I am trying to access a simple Rails application with one model to demonstrate the gem. The client and server apps are on the same machine, running on different ports. When I use the client application to access the server, I get the following error:

ActiveRestClient Person:/people - Trying to read from cache ActiveRestClient Person#all - Etag cached copy found with etag W/"d50983e777eccc158c4dec3372fb299b" ActiveRestClient Person#all - Requesting https://localhost:3000/people ActiveRestClient (20.6ms) Person#all Completed 500 Internal Server Error in 35ms (ActiveRestClient: 20.6ms for 1 calls | ActiveRecord: 0.0ms)

Faraday::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol): app/controllers/people_controller.rb:7:in `index'

I assume that this is a configuration issue, however I am unclear on how to get around the error.

andyjeffries commented 9 years ago

I can't see your Person model, but there is a clue when it says ActiveRestClient Person#all - Requesting https://localhost:3000/people - it looks like you've configured base_url on your model to use https. That's why it's trying to connect using SSL and giving an error (because the server isn't responding to SSL requests, only plain HTTP).

klancaster commented 9 years ago

Ugh. Not enough coffee today... That was it - must have copied it in from someplace. I am still seeing errors, however the https error is gone. Thanks for the quick response.

andyjeffries commented 9 years ago

No problem, happy to help. If you want to update this issue with the errors you are seeing, I can try to help there too? (if they're ARC-related)

andyjeffries commented 9 years ago

(to the owners, as I'm no longer one) - This can be closed