Last active
August 17, 2022 14:47
-
-
Save febimudiyanto/fc3813f0a61d62751b3c132e8dadb8e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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