Monday, November 9, 2015


Using HTTPS in is easy (provided you have your certificates).
Just import the WSGI server class from at the beginning of

    from web.wsgiserver import CherryPyWSGIServer

Then, add this code to the beginning of hkweb.start():

    CherryPyWSGIServer.ssl_certificate = "/path/to/your.crt"
    CherryPyWSGIServer.ssl_private_key = "/path/to/your.key"

And that's all. From now on, you can access hkweb via https://localhost:8080.

If you need a certificate, use this:

    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
    mv server.key myserver.key
    mv server.crt myserver.crt

Your browser will warn you about the certificate being invalid, but it
will work nonetheless.

The relevant Google Groups thread:

1 comment: