5

I am trying to connect to a AWS Redshift server via SSL. I am using psycopg2 library in python to establish the connection and used sslmode='require' as a parameter in the connect line. Unfortunately i got this error:

sslmode value "require" invalid when SSL support is not compiled in

I read many other similar cases for PostgreSQL which mention the problem exists with the PostgeSQL version, but i didn't find any solutions for Redshift using Psycopg2. Do i need to install any specific SSL certificate for Redshift? If yes, how do i do it with Psycopg2? Any help will be appreciated.

cppnoob
  • 129
  • 1
  • 4
  • 12

2 Answers2

1

This worked for me: https://stackoverflow.com/a/36489939/101266

had this same error, which turned out to be because I was using the Anaconda version of psycopg2. To fix it, I had adapt VictorF's solution from here and run:

conda uninstall psycopg2
sudo ln -s /Users/YOURUSERNAME/anaconda/lib/libssl.1.0.0.dylib /usr/local/lib
sudo ln -s /Users/YOURUSERNAME/anaconda/lib/libcrypto.1.0.0.dylib /usr/local/lib
pip install psycopg2
Community
  • 1
  • 1
David
  • 987
  • 1
  • 7
  • 14
0

Is your cluster enabled for SSL connections? Your URL itself will have the SSL info. and you can use the same in your code.

Paladin
  • 570
  • 3
  • 13