Bad HTTPS handling
Posted: Sun Sep 25, 2011 7:53 pm
HTTPS handling of Serendipity is not optimal.
To use both, HTTP and HTTPS, "Autodetect used HTTP-Host" has to be set. This causes "URL to blog" to change depending on the domain name or protocol.
The first thing that should be optimized is the port. When calling Serendipity over HTTPS with the setting above, the URL changes to https://example.com:443, but it would be better if it would just be https://example.com. The Port should only be added if it is not 80 for HTTP and not 443 for HTTPS.
The second and more severe issue is that I can't use the backend over HTTPS when I want my users to come over HTTP by default. For instance when I write a new article, all the paths in the sitemap (generated by the sitemap plugin) now begin with https://example.com:443/ instead of http://example.com/.
Therefore the setting "URL to blog" should be a fixed default setting used for things like this. It should not change when "Autodetect used HTTP-Host" is activated. Of course, the general path handling should remain the some, otherwise I would get mixed content on HTTPS connections when "URL to blog" is a HTTP URL, but for things like generating the sitemap, a fixed URL should be used, regardless of the domain or protocol I'm currently using for the backend.
To use both, HTTP and HTTPS, "Autodetect used HTTP-Host" has to be set. This causes "URL to blog" to change depending on the domain name or protocol.
The first thing that should be optimized is the port. When calling Serendipity over HTTPS with the setting above, the URL changes to https://example.com:443, but it would be better if it would just be https://example.com. The Port should only be added if it is not 80 for HTTP and not 443 for HTTPS.
The second and more severe issue is that I can't use the backend over HTTPS when I want my users to come over HTTP by default. For instance when I write a new article, all the paths in the sitemap (generated by the sitemap plugin) now begin with https://example.com:443/ instead of http://example.com/.
Therefore the setting "URL to blog" should be a fixed default setting used for things like this. It should not change when "Autodetect used HTTP-Host" is activated. Of course, the general path handling should remain the some, otherwise I would get mixed content on HTTPS connections when "URL to blog" is a HTTP URL, but for things like generating the sitemap, a fixed URL should be used, regardless of the domain or protocol I'm currently using for the backend.