Skip to content

Instantly share code, notes, and snippets.

@saucecode
Created December 31, 2016 06:50
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save saucecode/1f9424d1cd395d2103adeffa4550a054 to your computer and use it in GitHub Desktop.
Save saucecode/1f9424d1cd395d2103adeffa4550a054 to your computer and use it in GitHub Desktop.
how to correctly use a letsencrypt cert with flask
...
from OpenSSL import SSL
...
context = SSL.Context(SSL.TLSv1_2_METHOD)
context.use_privatekey_file('/etc/letsencrypt/live/DOMAIN.COM/privkey.pem')
context.use_certificate_chain_file('/etc/letsencrypt/live/DOMAIN.COM/fullchain.pem')
context.use_certificate_file('/etc/letsencrypt/live/DOMAIN.COM/cert.pem')
app.run(host='0.0.0.0', port=8080, threaded=True, ssl_context=context)
@Ozer0x777
Copy link

???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment