httpd = http.server.HTTPServer(server_address, http.server.
    SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, certfile=
    'localhost.pem', ssl_version=ssl.PROTOCOL_TLSv1)
Python 3 HTTPS Webserver