langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Support to use SSL for external DB connections

Open syoung-gaia opened this issue 1 year ago • 0 comments

Feature Request

Add SSL support for connecting to external databases.

Motivation

Hardening applications for production usually includes encrypting data both in transit and at rest. Currently, connecting Langflow to an external database does not use SSL which offers less security by increasing the attack vector.

Your Contribution

SSL is natively supported by Postgres, which appears to be a first-class citizen for external database considerations with Langflow. I was able to craft a work-around by appending additional arguments to the LANGFLOW_DATABASE_URL environment variable per this example:

LANGFLOW_DATABASE_URL=postgresql://langflow:[email protected]:5432/langflow_db?sslmode=require

Looking at the code, a better approach would likely be to pass such arguments into SQLAlchemy's create_engine() connect_args parameter.

syoung-gaia avatar Dec 13 '24 23:12 syoung-gaia