Search code examples
opensslamazon-redshiftpg

"PG::ConnectionBad: SSL error: point is not on curve" in Redshift via Ruby/PG gem using SSL


I'm getting the following error when trying to run a query on Amazon Redshift in Ruby (via the PG gem) over SSL:

PG::ConnectionBad: SSL error: point is not on curve

This error only happens on my local Mac OS X El Capitan machine when trying to connect via SSL. Connecting without SSL works fine. Connecting over SSL on Ubuntu dev server also works fine, which makes me think it's a problem with my local Ruby/OpenSSL setup.

Running Ruby 2.2.2, OpenSSL 1.0.2e, pg gem 0.18.2.

I've verified that my Ruby is using the expected version of OpenSSL:

2.2.2 :001 > OpenSSL::OPENSSL_VERSION => "OpenSSL 1.0.2e 3 Dec 2015"

I've also verified that the error happens both in Rails/ActiveRecord and in plain old ruby via the Sequel gem.

The pg database config that I'm using sets sslmode: require.

Thoughts?


Solution

  • I was using an old version of Postgres.app. Updating it to the latest version and re-installing ruby (via RVM) solved my issue.

    Current theory as to why this solve the issue: apparently Postgres.app provides psql or something else that is used in the process of compiling the native extensions for the pg gem. Whatever Postgres.app provided wasn't good and so the result propagated itself right into the gem and the app itself.