|
HTTPSDevelopment
How to use HTTPS with Django `runserver` command
IntroductionStarting with release 1.3 of Mozilla Weave/Firefox Sync the account-creation dialog automatically switches to HTTPS for communication with the server. The built-in development server for Django (runserver) does not support HTTPS, thus in order to test the application it's necessary to encapsulate HTTP traffic inside a SSL tunnel. InstructionsThe easiest way to achieve this is to use stunnel. It's available as a package for most major GNU/Linux distributions. Once it's installed it needs a X.509 certificate which can be generated with openssl: openssl genrsa 1024 > tunnel.key openssl req -new -x509 -nodes -sha1 -days 365 -key tunnel.key > tunnel.cert cat tunnel.key tunnel.cert >tunnel.pem This generates a self-signed certificate which should be sufficient for testing purposes. Do not use it in production environment! Now just run stunnel like this: stunnel -r localhost:8000 -d localhost:8443 -f -p tunnel.pem -P '' |
► Sign in to add a comment