Users discuss making auto-linked URLs use HTTPS by default in Discourse. renem wants to avoid mixed content errors from HTTP links, noting that while force_https is enabled, inline text links default to HTTP. pfaffman confirms the setting is enabled by default, but Arkshine points out it’s false by default in the code. Firepup650 and renem observe that links on new lines become HTTPS due to oneboxing and redirects. Stephen clarifies that HTTP links don’t trigger mixed content warnings, which are caused by insecure assets. Bas argues that changing the default to HTTPS isn’t necessary since most HTTPS sites redirect HTTP requests. renem explains the issue affects internal links embedded on the main site. pfaffman suggests using watched words to replace bare hostnames with HTTPS links, which renem plans to try. JammyDodger warns that this may conflict with markdown linkify TLDs.
I tried googling or searching but couldn’t find it. When I type a domain name such as discourse.org in a sentence, this becomes a link. This is a HTTP link:
Unless something has changed recently a link to an insecure site won’t trigger a mixed content error.
Mixed content errors refer to the assets which make up the page. If your site is https but loads assets from an insecure source then you would be serving mixed content.
Force_https refers to your discourse site and internal links within it.
A link on a new line oneboxes, rather than just being a link. To do that the link has to be ”loaded” and the default document at the destination is inspected. If the site uses https over http that redirect would take place.
Like @Stephen , I think you might be focussing on the wrong part. As far as I know, having a <a href="http... link will not trigger the mixed content warnings.
This error should only be triggered by embedding non-https content into your https site. So loading external images could be a culprit, or embedding a third party script, something in a theme maybe?
Probably good to dive deeper into the browser console and see what triggers the error
Let me explain. We have many users who type in our domain name in forum replies. We also embed forum replies on the main site so now I have some HTTP internal links instead of HTTPS. It’s not a big issue, but if I could make these HTTPS as well, that would be nice.
This is correct, it doesn’t trigger a mixed content warning
Is there anything I can do? Besides monitoring replies and perhaps writing a script to update URLS
I think these two features may not be compatible. If I remember right, the markdown linkify tlds seems to take precedence and won’t allow the link to be swopped out by the watched words replace.