Created
December 31, 2016 06:50
-
-
Save saucecode/1f9424d1cd395d2103adeffa4550a054 to your computer and use it in GitHub Desktop.
how to correctly use a letsencrypt cert with flask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
???