Skip to content

Instantly share code, notes, and snippets.

@0xBADCA7
Created May 21, 2015 19:09
Show Gist options
  • Save 0xBADCA7/41f3ece467204b799b79 to your computer and use it in GitHub Desktop.
Save 0xBADCA7/41f3ece467204b799b79 to your computer and use it in GitHub Desktop.

Revisions

  1. 0xBADCA7 created this gist May 21, 2015.
    9 changes: 9 additions & 0 deletions ssl_server.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/usr/bin/env python3

    from http.server import HTTPServer,SimpleHTTPRequestHandler
    from socketserver import BaseServer
    import ssl

    httpd = HTTPServer(('localhost', 1443), SimpleHTTPRequestHandler)
    httpd.socket = ssl.wrap_socket (httpd.socket, certfile='certificate.pem', keyfile='privatekey.pem', server_side=True)
    httpd.serve_forever()