I am trying to connect to my postgres database using psycopg2 with sslmode=\'required\' param; however, I get the following error
psycopg2.OperationalError:
If you're using v2.6.1 or v2.6.2 of psycopg2 (like me), the answer was a simple upgrade to v2.7. Reading the release notes for psycopg2, there was a minor fix for SSL albeit it doesn't look particularly relevant.
My setup was as follows:
Running pip uninstall psycopg2 followed by pip install psycopg2 resolved matters.