4

When I use SQLAlchemy with an external postgreSQL server, is the connection secured/encrypted?

from sqlalchemy.engine import create_engine engine = create_engine('postgresql://scott:tiger@ip:5432/mydatabase')

What about psycopg2?

1 Answer 1

5

Your connection string does not indicate secure connection. However, sometimes connection might be secure nevertheless, but it is unlikely.

To have a secure connection to PostgreSQL database you can use sslmode parameter.

 engine = create_engine('postgresql://scott:tiger@ip:5432/mydatabase?sslmode=verify-full')

verify-full is the highest level SSL connection validation where the client performs full SSL certificate check for the connection.

More info:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.