[sudo] apt-get install stunnel
cd path/to/django/project
mkdir stunnel
cd stunnel
Create the key:
openssl genrsa 1024 > stunnel.key
openssl req -new -x509 -nodes -sha1 -days 365 -key stunnel.key > stunnel.cert
cat stunnel.key stunnel.cert > stunnel.pem
Create the dev_https
file with:
pid=
cert = stunnel/stunnel.pem
foreground = yes
output = stunnel.log
[https]
accept=0.0.0.0:8443
connect=0.0.0.0:8000
TIMEOUTclose=1
In one terminal run:
stunnel stunnel/dev_https
In another, run:
./runserver
Sets the permission:
chmod a+x runserver
The SSL works in:
https://localhost:8443