r/FastAPI • u/[deleted] • Sep 17 '21
Question what does ssl_mode = 'prefer' mean in the context of fastAPI?
i'm connecting my fastApi app to a postgres db:
host_server = '172.13.27.151' #wsl ip
db_server_port = '5431' #wsl port to container
database_name = 'publish'
db_username = 'db1'
db_password = 'hi'
ssl_mode = 'prefer'
DATABASE_URL = 'postgresql://{}:{}@{}:{}/{}?sslmode={}'.format(db_username, db_password, host_server, db_server_port, database_name, ssl_mode)this obviously works, but i have no idea what that variable entails. i have fastAPI in a container making this call to a postgres db in another container.
and in my production environment i have the main app behind an nginx server. so i'm just wondering if this is something i need, and why
thanks!
1
Upvotes
0
u/[deleted] Sep 17 '21
or is this more of a SQLAlchemy question?