15 lines
		
	
	
		
			435 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			435 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from http.server import HTTPServer, SimpleHTTPRequestHandler
 | 
						|
import ssl
 | 
						|
 | 
						|
server_address = ('0.0.0.0', 4443)
 | 
						|
httpd = HTTPServer(server_address, SimpleHTTPRequestHandler)
 | 
						|
 | 
						|
context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
 | 
						|
context.load_cert_chain(certfile='cert.pem', keyfile='key.pem')
 | 
						|
 | 
						|
httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
 | 
						|
 | 
						|
print('Serving HTTPS on 0.0.0.0 port 4443...')
 | 
						|
httpd.serve_forever()
 | 
						|
 |