DEV Community

Discussion on: Local development with HTTPS on OSX

Collapse
 
taknil profile image
Hippopothomas

These very few lines of python do it for me with a self signed certificate:

import BaseHTTPServer, SimpleHTTPServer
import ssl

httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./server.pem', server_side=True)
httpd.serve_forever()