Open RichVel opened 11 years ago
The "connection interrupted" error is expected. If you are running sslserver on port 8000 and try to connect to it via https, the browser won't negotiate an encrypted connection when the server wants it, and the browser will be all like "I have no idea what this server is talking about".
That's why production HTTPS runs over TCP 443 and HTTP runs over TCP 80.
This certainly deserves attention, though. I suspect that the "right answer" is for sslserver to spin an SSL listening socket on 8443, and an unencrypted socket on 8000. I could also add an automatic redirection middleware, so you don't end up adding a few more dependencies for something that should be "batteries included".
What so you think, would you rather sslserver include the redirect functionality, or do you want to use a separate app for that?
Late reply... maybe you could say which ports I should use by default with django-sslserver - something like 8000 for http and 8443 for https would make sense.
The django-privatebeta middleware is doing a redirect in some cases, which may be interfering with some other redirect when used with django-sslserver.
I've run into a similar, continuous redirection problem using django-hilbert's SSLRedirectMiddleware.
As I can see, request handled by django-sslserver are not considered to be secure by django. Checking request.is_secure()
returns False
.
In the same line, adding a redirect middleware to this package seems to be a bad idea to me, as I would never want to have django-sslserver serve a production ready site, thus I would like the redirect middlewares to work separately of sslserver, and sslserver would be used for testing.
statring sslserver as HTTPS=1 ./manage.py runsslserver 8443
solved my issue
Thank You you made me smile
I get a redirect loop using Django 1.4 - I'm using the django-privatebeta middleware which does redirections, plus easy-userena which is configured to redirect http to https. Happens with https://localhost:8000/
Also, with http://localhost:8000/, I get 'connection was interrupted' in Chrome. The site works OK with the normal runserver.