File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# absolute path of pyServer.py
44thisScriptPath = os .path .dirname (os .path .abspath (__file__ ))+ '/'
55
6- # generated seld signed certificate usin openssl command
6+ # generate self signed certificate using openssl command
77def generate_selfsigned_cert ():
88 try :
99 OpenSslCommand = 'openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out ' + thisScriptPath + 'cert.pem -keyout ' + thisScriptPath + 'key.pem -subj "/C=IN/ST=Maharashtra/L=Satara/O=Wannabees/OU=KahiHiHa Department/CN=www.iamselfdepartment.com"'
@@ -24,16 +24,17 @@ def startServer(host,port):
2424 )
2525 print ("File Server started at https://" + server_address [0 ]+ ":" + str (server_address [1 ]))
2626 httpd .serve_forever ()
27-
27+
28+ # entry point of script
2829def main ():
2930 try :
3031 generate_selfsigned_cert ()
3132 # you can change the host and port
3233 startServer ('localhost' ,8000 )
3334 except KeyboardInterrupt :
3435 print ("\n File Server Stopped!" )
35-
36- # entry point of script
36+
37+ # call to main function
3738main ()
3839
3940'''
You can’t perform that action at this time.
0 commit comments