Connexion: How to use HTTPS ?

Created on 17 Feb 2020  路  3Comments  路  Source: zalando/connexion

Description

I made a connexion API and i do not succeed to go from HTTP to HTTPS
Is it even possible ? I don't see any exemples on it.

Here is the entrypoint of my API:

def main():
    flask_app = connexion.FlaskApp(
        __name__,
        port=9090,
        specification_dir='test/')

    flask_app.add_api(TEST_FILE)

    if flask_app.app.config['ENV'] == 'prod':
        serve(flask_app, port=9090)
    else:
        flask_app.run()

If i can add ssl_context=context (like in flask) somewhere it will be perfect but I cannot see where to put it.

Do I need to edit my schemes in my swagger files too ?

Thank you for your help.

question

Most helpful comment

Hey @rudyces - I recommend terminating SSL using a reverse proxy like nginx or caddy.

All 3 comments

Hey @rudyces - I recommend terminating SSL using a reverse proxy like nginx or caddy.

Thanks @dtkav, so there is absolutely no way to give an argument like ssl_context as an argument somewhere ?

I setted up a gunicorn server to launch the app using SSL at the end.

Was this page helpful?
0 / 5 - 0 ratings