Skip to content

Instantly share code, notes, and snippets.

@hummus
Last active June 24, 2016 13:03
Show Gist options
  • Save hummus/1047d5efa95d4b71e8fb5d9872314023 to your computer and use it in GitHub Desktop.
Save hummus/1047d5efa95d4b71e8fb5d9872314023 to your computer and use it in GitHub Desktop.
SimpleHTTPSServer
# SimpleHTTPServer oneliner
openssl req -new -x509 -keyout /dev/stdout -out /dev/stdout -days 365 -nodes -subj "/C=XX/O=Default Company Ltd" 2>/dev/null > yourpemfile.pem ; python -c 'import sys, BaseHTTPServer, SimpleHTTPServer; import ssl; httpd = BaseHTTPServer.HTTPServer(("0.0.0.0", 4443), SimpleHTTPServer.SimpleHTTPRequestHandler); httpd.socket = ssl.wrap_socket (httpd.socket, server_side=True, certfile=sys.argv[1]); httpd.serve_forever()' yourpemfile.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment