-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL on flask-migrate #343
Comments
Yes, at this point Flask-Migrate only takes the database URL from the Flask-SQLAlchemy configuration, not the engine options. If you move your SSL options to the query string of your database URL you should be fine, I think. But in any case, I should look into adding the engine options if possible. |
@miguelgrinberg Thanks for the quick response. connectable = create_engine(
current_app.config['SQLALCHEMY_DATABASE_URI'],
**current_app.config['SQLALCHEMY_ENGINE_OPTIONS']
) |
@Luttik yeah, that is probably okay. I was actually thinking that this might work:
This basically steals the engine object from Flask-SQLAlchemy, so you are not creating a second engine just for Alembic. |
That seems like a great way to simplify the env.py file. |
Edit: Ok, I think I did understand. I modified the env.py file in the migration folder. It works ;) Hello, is this forecasted to make Flask-Migrate use the engine options to connect to the DB with ssl? There is maybe this solution:
But I don't know where/how to use it ? Thank you |
Hi I have a (possibly dumb) issue with SSL and Flask-Migrate.
I instanciate the flask app with
SQLALCHEMY_DATABASE_URI
andSQLALCHEMY_ENGINE_OPTIONS
usingapp.config.from_object
(drawing inspiration from the Falsk Mega-Tutorial).The arguments seems to work, I tested with:
My engine_options are as follows:
where
self.db.ssl_ca
,self.db.ssl_cert
andself.db.ssl_key
are absolute paths or the necessary ssl files.It seems to me like flask-migrate ignores these since SSL is off when I according to the error message.
I have attached the traceback below:
Traceback.txt
I hope you can help me since I'm fully stuck at this point.
The text was updated successfully, but these errors were encountered: