Skip to content

Instantly share code, notes, and snippets.

@ryanbekabe
Created October 12, 2020 01:00
Show Gist options
  • Save ryanbekabe/85f69d4545ad1f151587c97eace8904c to your computer and use it in GitHub Desktop.
Save ryanbekabe/85f69d4545ad1f151587c97eace8904c to your computer and use it in GitHub Desktop.
Pyton Flask with SSL Let's Encrypt
#Pyton Flask with SSL Let's Encrypt
#Source: https://bits.mdminhazulhaque.io/python/run-flask-app-with-let's-encrypt-ssl-certificate.html
import requests
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def serve():
return "Hello world", 200
if __name__ == '__main__':
app.run(host="107.173.229.88", port=8080, ssl_context=('/etc/letsencrypt/live/hanyajasacom.rek.my.id/fullchain.pem', '/etc/letsencrypt/live/hanyajasacom.rek.my.id/privkey.pem'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment