Direct SSL is not sent to Django
See original GitHub issueWhen you start up Daphne with SSL enabled and generate absolute URLs in your Django application, the resulting URLs does not use HTTPS, but HTTP.
This results in unusable URLs.
If you want to know if a request is using ssl, use request.isSecure()
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How can you drop an HttpRequest connection in Django ...
I'm writing a Django 1.3 view method which requires TLS/SSL to be used. I want to entirely drop the connection if an HttpRequest...
Read more >Trying to make a Django-based site use HTTPS-only, not sure ...
Submit your domain to an SSL Test to check for potential problems (too short key, not using TLSv1.2, using broken protocols, etc.).
Read more >Error since added SSL certificate - Google Groups
I eel recently added an SSL certificate to my domain where the application is hosted with Django. Since I setup the SSL certificate...
Read more >Sending email | Django documentation
The EMAIL_HOST_USER and EMAIL_HOST_PASSWORD settings, if set, are used to authenticate to the SMTP server, and the EMAIL_USE_TLS and EMAIL_USE_SSL settings ...
Read more >http.client — HTTP protocol client — Python 3.11.1 ...
It is normally not used directly — the module urllib.request uses it to h... ... HTTPS support is only available if Python was...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Andrew,
I know you said this is now fixed in Daphne master (which I assume falls in line with the release tag 1.2.0)
I am having the same issue as JohnDoee above where I access a HTTPS url endpoint, and the URL generated by the Django application is HTTP. I am seeing this when using LimitOffsetPagination and CursorPagination from the Django Rest Framework.
I initially found this issue and upgraded all the packages on the box, below is my pip freeze list.
Note: I am not running Channels 1.1.3 since pip could not find this (the release was <24 hours ago when I installed it so it gathered 1.1.2)
The front end applications are disallowed from using HTTP due to restrictions that we have set on the Amazon Web Services box to only allow HTTPS traffic and deny HTTP, so when they use the ‘next’ url generated by Django in pagination, the front end receives a connection refused since it isn’t HTTPS.
Example:
I hit the endpoint on my application
https://url.tld/messages
which sends back to the front end a set of message objects (paginated) and therefore has a ‘next’ and ‘previous’ URL generated by Django. This generated URL is sent back in ‘next’ (or ‘previous’) ashttp://url.tld/messages?limit=10&offset=10
.Any help would be appreciated.
Hi Andrew, that worked great thanks a lot!