Skip to content

Instantly share code, notes, and snippets.

@febimudiyanto
Last active August 17, 2022 14:47
Show Gist options
  • Save febimudiyanto/fc3813f0a61d62751b3c132e8dadb8e4 to your computer and use it in GitHub Desktop.
Save febimudiyanto/fc3813f0a61d62751b3c132e8dadb8e4 to your computer and use it in GitHub Desktop.
# Date : 17 - 08 - 2022
# Ref: RTFM v2
'''
Python3 simple-https-server.py
'''
import http.server, ssl, socketserver
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.load_cert_chain("cert.pem") # PUT YOUR cert.pem HERE
server_address = ("192.168.43.210", 4443) # CHANGE THIS IP & PORT
handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(server_address, handler) as httpd:
httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment