Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer HTTPS for readthedocs.io domains #3282

Closed
gwillem opened this issue Nov 18, 2017 · 14 comments
Closed

Prefer HTTPS for readthedocs.io domains #3282

gwillem opened this issue Nov 18, 2017 · 14 comments
Labels
Improvement Minor improvement to code

Comments

@gwillem
Copy link
Contributor

gwillem commented Nov 18, 2017

Details

Could we have default/preferred RTD HTTPS urls? As major browsers increasingly deprecate non-HTTPS content. Also, we cannot overwrite the current HTTP canonical url, as it is inserted by RTD at the end of the section.

Expected Result

I would expect:

  1. To get 301 redirected to the https version.
  2. To have the https url as canonical url in the HTML.

Actual Result

nope

PS. Thanks for making a great service!

@RichardLitt RichardLitt added the Improvement Minor improvement to code label Nov 20, 2017
@agjohnson agjohnson added this to the More secure doc pages milestone Nov 21, 2017
@agjohnson agjohnson added the Operations Operations or server issue label Nov 21, 2017
@codelucas
Copy link

Anyone working on this one? Seems important as browsers deprecate non https

@agjohnson agjohnson added the Needed: design decision A core team decision is required label Feb 27, 2018
@ericholscher
Copy link
Member

+1 on this. I think it will be a multi-step process, but we should get started with it. The primary thing we want to avoid is linking to https pages when those pages have http images or similar, causing mixed content warnings. I think that might just be part of the process of the migration, but here is my thoughts:

  • We start linking "View Docs" and similar to HTTPS for projects on readthedocs.io domains, and see what happens, if it breaks much
  • We start redirecting HTTP -> HTTPS on readthedocs.io domains for projects.
  • We implement letsencrypt certs for CNAME's that we host
  • We start linking "View Docs" on CNAME's that we have a cert for with HTTPS
  • We start auto-redirecting HTTP -> HTTPS for CNAME's

@edmorley
Copy link

edmorley commented Mar 1, 2018

The primary thing we want to avoid is linking to https pages when those pages have http images or similar, causing mixed content warnings.

The upgrade-insecure-requests CSP directive may help reduce the breakage:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests
https://community.akamai.com/community/web-performance/blog/2017/02/10/how-to-auto-upgrade-to-https-aka-avoid-mixed-content

(or at least provide a way to see what would break, via Content-Security-Policy-Report-Only)

@agjohnson agjohnson changed the title Prefer HTTPS Prefer HTTPS for readthedocs.io domains Mar 8, 2018
@agjohnson agjohnson removed Needed: design decision A core team decision is required Operations Operations or server issue labels Mar 8, 2018
@agjohnson
Copy link
Contributor

I agree with the steps laid out here. I'm going repurpose this task to deal with just readthedocs.io domains, as the other steps are mostly operations changes. I'll open up corresponding issues on our server provisioning repositories to deal with those.

@davidfischer
Copy link
Contributor

This is going live next week

@davidfischer
Copy link
Contributor

Just to give a small update here, this is partially live. We deployed a change such that all "view docs" links on Read the Docs will now have an HTTPS link. However, we are not yet issuing a redirect. That change will probably go live this week as a 302 redirect. If all goes well, we will update that to a 301 redirect.

@dmalan
Copy link

dmalan commented Aug 15, 2018

Hi @davidfischer, all, just wanted to check if deployment of 302 (or 301) redirects is still pending for docs using non-custom subdomain.readthedocs.io URLs? Is there any way we can induce on our end in the meantime, as via .readthedocs.yml or such? Afraid I only saw HTTPS settings under Admin for custom domains. Thank you!

@davidfischer
Copy link
Contributor

Afraid I only saw HTTPS settings under Admin for custom domains.

Currently all this check box does is ensure that the link generated for custom domains is HTTPS. This is already the case for all *.readthedocs.io sites.

@dmalan
Copy link

dmalan commented Aug 15, 2018

Ah, are there still plans to issue 302 (or 301) redirects for visits to http://*.readthedocs.io/*?

@davidfischer
Copy link
Contributor

Ah, are there still plans to issue 302 (or 301) redirects for visits to http://*.readthedocs.io/*?

Yes. I have an open PR for this in our operations repo and I just need to guide it through review and deployment. Sorry it's taking so long.

@davidfischer
Copy link
Contributor

Thanks for reminding me. This is live as a 302.

@davidfischer
Copy link
Contributor

I'm going to make a PR right now that changes the 302 to a 301 but my plan is to not merge that for a couple weeks to a month in case I see any reported issues.

I'm closing this though as we are now redirecting.

@davidfischer
Copy link
Contributor

We start auto-redirecting HTTP -> HTTPS for CNAME's

The last step of this 5 step plan is being tracked in #2652. This is a bit trickier as it requires a database lookup or API call to know if we have a certificate for any specific domain.

@dmalan
Copy link

dmalan commented Aug 15, 2018

Thanks very much! Working well so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

8 participants