[Twisted-Python] Forcing Twisted / Klein to use HTTPS

Jean-Paul Calderone exarkun at twistedmatrix.com
Wed Aug 30 09:42:30 MDT 2017


On Wed, Aug 30, 2017 at 11:36 AM, Chris Norman <chris.norman2 at googlemail.com
> wrote:

> Hi all,
>
> I'm trying to force Klein to use HTTPS, and so far I have a custom error
> handler which redirects the user to the HTTPs version of the page via a
> check_secure function which takes the request object and raises the right
> error if request.isSecure() is False.
>
>
> Is there a better global way to enforce HTTPS with any part of Klein or
> Twisted?
>
>
The way I do this is to make one Site that listens on HTTP and does nothing
except redirect to HTTPS.  The real site only listens on HTTPS.


>
> Cheers,
>
>
> Chris
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20170830/038b0ac7/attachment-0002.html>


More information about the Twisted-Python mailing list