May 27, 2015
Web Py SSL
I assume you have a Mac computer and web.py is already installed. I also assume openssl is installed. Follow the steps below to enable SSL on your web server.
-
- openssl genrsa -des3 -out server.key 1024
- openssl req -new -key server.key -out server.csr
- openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
- In your python server code, copy the following
1 2 3 |
from web.wsgiserver import CherryPyWSGIServer CherryPyWSGIServer.ssl_certificate = "/path/to/server.crt" CherryPyWSGIServer.ssl_private_key = "/path/to/server.key" |
-
- Point to your server for example: http://127.0.0.1:9999 This should not work
- Now try : https://127.0.0.1:9999 This should work
- If the server keeps nagging about the password. You can do:
1 |
openssl rsa -in server.key -out server_nopass.key |