我正在尝试通过 SSL 连接到 AWS Redshift 服务器。我在 python 中使用 psycopg2 库来建立连接,并使用 sslmode='require'
作为连接行中的参数。不幸的是我得到了这个错误:
sslmode value "require" invalid when SSL support is not compiled in
我读过许多其他类似的 PostgreSQL 案例,其中提到 PostgeSQL 版本存在问题,但我没有找到使用 Psycopg2 的 Redshift 的任何解决方案。我需要为 Redshift 安装任何特定的 SSL 证书吗?如果是,我如何使用 Psycopg2 进行操作?任何帮助将不胜感激。
最佳答案
这对我有用: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
关于python - 使用 Psycopg2 与 Redshift 的 SSL 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37584629/