title: How to set Flask 'ssl_context' as an environment variable or served via a config file?
body: <p>Hoping someone can help me as I'm struggling to find the answer to this anywhere.</p>
  <p>I'm building a Flask app which has to be run in HTTPS. In local development, I'm just doing a really quick ssl_context='adhoc' when running the app as per the below:</p>
  <pre><code>if __name__ == &quot;__main__&quot;:
  app.run(
      ssl_context='adhoc',
  )
  </code></pre>
  <p>This works perfectly but as I'm now getting ready to start testing via Heroku I'd like to change this so that the ssl_context is set in my config file:</p>
  <pre><code>import os
  from decouple import config
  
  
  class Config:
      DEBUG = False
      DEVELOPMENT = False
      SECRET_KEY = config('SECRET_KEY')
  
  
  class ProductionConfig(Config):
      pass
  
  
  class StagingConfig(Config):
      DEBUG = True
  
  
  class DevelopmentConfig(Config):
      DEBUG = True
      DEVELOPMENT = True
      # Add cert here
  </code></pre>
  <p>I've tried using FLASK_RUN_CERT = 'adhoc' but that doesn't work and I'm stumped as to what else I can use here. I don't mind removing the ssl_context='adhoc' every time I commit but if I can avoid it that would be preferential.</p>
  <p>Any advice would be greatly appreciated.</p>