I have CiviCRM sites (5.12 and 5.13 on Drupal 7 with Aegir 3) where the behaviour of CiviMail initialisation (and the admin status page) depends on particular HTTPS setup: finishes or loops infinitely.

How HTTPS setup influences this behaviour? How to configure HTTPS on Cloudflare to avoid interference with CiviMail?

  • When HTTPS managed by Aegir, the mailing initialisation works.
  • When HTTPS are managed by Cloudflare and Pound, but not Aegir, mailing initialising never ends. Workaround here to run on plain HTTP, which is hardly acceptable.

The status page for CRM administrators also behave differently, it point to some Angular issues.

(update) Error in console:

Blocked loading mixed active content “http://example.com/sites/example.com/files/civicrm/persist/contribute/dyn/angular-modules.87ce61fa6dc174d5e3e11f666ca386e5.json”[Learn More] a:1:778
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ jquery.min.js:4:26272
Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead jquery.min.js:2:21
WARNING: Tried to load angular more than once. jquery.min.js:320:189

Solved: this D7 patch has solved the issue. More info here.

  • Have you checked your browser's dev tools, both the Console tab for errors and your Network tab for infinite redirects and HTTP errors? If so, and you find an answer, please post it! If not, please edit your question to include any errors (or the lack of them). – Jon G - Megaphone Tech May 6 at 14:25
  • One thing to check is that the domain name is correct and matches the certificate, which is maybe a generic cloudflare certificate. One thing about cloudflare is that depending on your setup the real IP address is hidden and you can access it from different domain names, however I have had it working on cloudflare. – Demerit May 6 at 20:11

It sounds like you have "http://" hard-coded into your URLs. Check your BASE_URL in civicrm.settings.php (and search the whole file for "http://" while you're there), and check the Administer » System Settings » Resource URLs menu to ensure that your resource URL doesn't include "http://".

Finally, check if you have any extensions that have the text hook_civicrm_getAssetUrl, which suggests that they may be changing the Asset URL.

  • ´BASE_URL´ is ok, it is set in Aegir ´global.inc´ file: ´// Drupal 7 configuration. if (explode('.', VERSION)[0] == 7) { $conf['reverse_proxy'] = TRUE; $conf['reverse_proxy_addresses'] = ['']; // Force the protocol provided by the proxy. This isn't always done // automatically in Drupal 7. Otherwise, you'll get mixed content warnings // and/or some assets will be blocked by the browser. if (php_sapi_name() != 'cli') { $base_url = $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://' . $_SERVER['SERVER_NAME']; } } ´ – Doka May 8 at 7:55
  • Hmm - if this is Aegir-specific, I won't be much help. You might want to ask in the ~sysadmin channel of chat.civicrm.org. One of the most knowledgeable people there uses Aegir extensively. – Jon G - Megaphone Tech May 8 at 18:25
  • This Drupal patch (drupal.org/project/drupal/issues/2970929), support X-Forwarded-* HTTP headers alternates, has solved the issue. More explanation here: drupal.org/node/425990. Thanks for the hint! – Doka May 11 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.