When using AWS Cloudfront for HTTPS requests you cannot specify a custom domain name, as this would require you're certificate being installed on their global network of servers. Instead, you need to use their cloudfront.net domain with their wildcard certificate.

I would like to implement a separate "MODE-SPECIFIC SETTINGS" interface element which would allow you to specify the HTTPS domains.

Thoughts?

Comments

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

I think this is a problem only if you want to use your own vanity domain name as an alias for the cloudfront domain name, no? Then why not just always use the cloudfront domain name?

wim leers’s picture

Oh, I just noticed this was documented at #1047182: Document that HTTPS breaks if one uses a vanity subdomain (CNAME) for a CDN that supports HTTPS requests. It's documented in the admin interface, but only in the dev snapshot, not yet in a release. That will change soon.

bendodd’s picture

I use vanity domains so that both the code looks better with more connections are to servers people know and trust, but mostly to allow multiple domains to be used, and allow more simultaneous downloads: http://code.google.com/speed/page-speed/docs/rtt.html#ParallelizeDownloads

bendodd’s picture

...this is not possible though for https, as cloudfront only provides one domain

wim leers’s picture

Status: Postponed (maintainer needs more info) » Active

I thought I'd read somewhere that you'd need unique IP addresses for that too work (meaning that what Google states there, and what many others state, is in fact wrong), but I can't find it. I guess I must have imagined that.

Your use case is obviously valid.

Obviously, I welcome patches. Secondly, I'm wondering what you propose in terms of UI?

bendodd’s picture

Haven't really thought about the UI, but I'm guessing we need another 'CDN mapping' box (CDN HTTPS mapping?). But there is something odd about having to go to the following tab to indicate support for HTTPS. Perhaps we could move the 'CDN supports HTTPS' select to the previous/same tab?

wim leers’s picture

I know, but the problem is that most people don't need this, and hence we provide them with a boatload of settings they don't need…

bendodd’s picture

I guess we only need to show the textarea if the https checkbox is checked? Or move to a sub-module?

bendodd’s picture

Initial ideas for functionality here: https://github.com/bendodd/drupal-6-cdn/tree/help_https

Just need to move these changes to it's own patch...

wim leers’s picture

I just replied to #1204400: Supply different CDN hosts for HTTPS, which is strongly related to this.

bendodd’s picture

We are working on a patch for this today and will hopefully have it to test tomorrow. It will use a checkbox to reveal a second textarea if needed:
http://drupal.org/files/cdn_admin_details.png

wim leers’s picture

I think this should be at admin/settings/other; there it could appear below the "CDN supports HTTPS" setting. Doesn't that also make more sense to you?

andreiashu’s picture

@wim re #11, #12: how about having both HTTPS related options on the details page? I think it would make more sense to have the "CDN supports HTTPS" option show the "Select different mappings for HTTPS" option which in turn, when checked, will show the text area with mappings for https?

andreiashu’s picture

I forgot to mention that I think they would be more useful on the details page because then you would have both http and https mappings on the same screen.

wim leers’s picture

#13, #14: Yet HTTPS mappings are rarely necessary. The UI is optimized for the common use case.

andreiashu’s picture

Status: Active » Needs review
StatusFileSize
new5.71 KB

I took bendodd's code, organised it a bit and now we have a patch.
I still need to move the options around in the admin settings area but I'd like a quick review from you guys.

andreiashu’s picture

StatusFileSize
new5.85 KB

New patch attached which:
- has all the HTTPS related settings on the "other" tab;
- I got rid of the CDN_BASIC_MAPPING_HTTPS_ENABLED_VARIABLE var. We have one less variable_get(set) - on the details page we don't have a checkbox for the normal CDN mappings

andreiashu’s picture

StatusFileSize
new5.58 KB

Minor amend to the previous patch so that it doesn't include whitespace change around '_cdn_ufi_deployment_id' function.

andreiashu’s picture

StatusFileSize
new6.83 KB

Rerolled against latest 6.x-2.x branch

andreiashu’s picture

bump

wim leers’s picture

StatusFileSize
new4.81 KB

Thanks for the patch! It contained *a lot* of flaws though.

- it contained changes from previous patches; this forced me to apply all of your changes manually
- the two new public functions you added to the .module file had weird logic checks
- cdn_get_domains() needs the *raw* mappings, but you're passing it the *parsed* mappings through the new cdn_basic_get_mapping() function you've introduced

Reroll attached. Against 6.x-2.x-dev.

andreiashu’s picture

Hi Wim,

Thanks for re-rolling and fixing it. I'll give it a try on Monday.

andreiashu’s picture

Status: Needs review » Reviewed & tested by the community

Works for me: it picks up the files from the https CDN when necessary.

bendodd’s picture

With a fresh GIT checkout of the dev branch and this patch applied, I get:

Fatal error: Call to undefined function _cdn_requirements_get_integration_mechanism() in
#######/sites/all/modules/contributed/cdn/cdn.admin.inc on line 20
I have also confirm this on a fresh installation at Pantheon (let me know if you want access to the codebase/admin):
http://dev.comicrelief-test.gotpantheon.com

Fatal error: Call to undefined function _cdn_requirements_get_integration_mechanism() in /srv/bindings/2c15305bc7cd4bed8527316bb254d667/code/sites/all/modules/contrib/cdn/cdn.admin.inc on line 20

andreiashu’s picture

@bendodd: please try this patch. The bug was introduced by the advanced help patch: http://drupal.org/node/1413162

bendodd’s picture

This patch does fix the issue for me locally and on Pantheon.

wim leers’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Fixed
wim leers’s picture

wim leers’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

doublejosh’s picture

Awesome. However, the DNS prefetching is still set to the HTTP domain(s).

doublejosh’s picture

Status: Closed (fixed) » Needs work
ArtActivator.com’s picture

Category: feature » bug
Priority: Normal » Major

Subscribing to DNS prefetching...

wim leers’s picture

Category: bug » feature
Priority: Major » Normal
Status: Needs work » Closed (fixed)

#31: please create a new issue for this; don't reopen issues that have been closed such a long time ago, just refer to this one when you do so :)