As described above, when using the reCaptcha plugin on Site A, I get an error returned:
Ambethia::ReCaptcha::ReCaptchaError (Host is down - connect(2)):
However, on Site B (both running locally) reCaptcha works. A bit more experiementing with Site A and I got it to work, by doing something rather....odd.
system("ping -c 1 #{RECAPTCHA_VERIFY_SERVER}")
recaptcha = Net::HTTP.post_form URI.parse("http://#{RECAPTCHA_VERIFY_SERVER}/verify"), {
:privatekey => ENV['RECAPTCHA_PRIVATE_KEY'],
:remoteip => request.remote_ip,
:challenge => params[:recaptcha_challenge_field],
:response => params[:recaptcha_response_field]
}
Yes, I put a single ping to the server before I posted the form. It was originally just a logger statement to see if my app could ping the server, however after it worked, I left it implemented.
Looking to see if perhaps we can figure out what's causing this oddity, and why the ping allows it to work.