Answers.Body: <p>It sounds like you have "http://" hard-coded into your URLs.  Check your <code>BASE_URL</code> in <code>civicrm.settings.php</code> (and search the whole file for "http://" while you're there), and check the <strong>Administer » System Settings » Resource URLs</strong> menu to ensure that your resource URL doesn't include "http://".</p>
  
  <p>Finally, check if you have any extensions that have the text <code>hook_civicrm_getAssetUrl</code>, which suggests that they may be changing the Asset URL.  </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T07:55:15.883Z
Answers.Text: ´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'] = ['192.168.1.1'];
  
    // 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'];
    }
  }
  ´
Answers.UserDisplayName: Doka
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-08T18:25:27.740Z
Answers.Text: Hmm - if this is Aegir-specific, I won't be much help.  You might want to ask in the ~sysadmin channel of https://chat.civicrm.org.  One of the most knowledgeable people there uses Aegir extensively.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-11T17:23:08.513Z
Answers.Text: This Drupal patch (https://www.drupal.org/project/drupal/issues/2970929), support X-Forwarded-* HTTP headers alternates, has solved the issue. More explanation here: https://www.drupal.org/node/425990. Thanks for the hint!
Answers.UserDisplayName: Doka
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-31T15:42:25.517Z
Answers.Text: is this useful https://gist.github.com/sunilpawar/e60224369a155b3255db3916fa44383b
Answers.UserDisplayName: Sunil Pawar
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-06T20:16:04.620Z
Answers.LastActivityDate: 2019-05-06T20:16:04.620Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>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.</p>
  
  <p>How HTTPS setup influences this behaviour? How to configure HTTPS on Cloudflare to avoid interference with CiviMail?</p>
  
  <ul>
  <li>When HTTPS managed by Aegir, the mailing initialisation works.</li>
  <li>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.</li>
  </ul>
  
  <p>The status page for CRM administrators also behave differently, it point to some Angular issues.</p>
  
  <p>(update) Error in console:</p>
  
  <pre><code>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
  </code></pre>
  
  <p><strong>Solved</strong>: this <a href="https://www.drupal.org/project/drupal/issues/2970929" rel="nofollow noreferrer">D7 patch</a> has solved the issue. More info <a href="https://www.drupal.org/node/425990" rel="nofollow noreferrer">here</a>.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-06T14:25:14.070Z
Comments.Text: 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).
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-05-06T20:11:11.753Z
Comments.Text: 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.
Comments.UserDisplayName: Demerit
Tags: <drupal><civimail><angular><aegir>
Title: How do HTTPS settings interfere with CiviMail?
ThreadText: # How do HTTPS settings interfere with CiviMail?
  
  (Asked by: username_0 on 2019-05-06)
  
  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.
  
  **Tags:** drupal, civimail, angular, aegir
  
  > **Comments:**
  > **username_1**: 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).  
  > **username_2**: 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-06. Score: 1 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: ´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'] = ['192.168.1.1'];    // 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'];   } } ´  
  > **username_1**: Hmm - if this is Aegir-specific, I won't be much help.  You might want to ask in the ~sysadmin channel of https://chat.civicrm.org.  One of the most knowledgeable people there uses Aegir extensively.  
  > **username_0**: This Drupal patch (https://www.drupal.org/project/drupal/issues/2970929), support X-Forwarded-* HTTP headers alternates, has solved the issue. More explanation here: https://www.drupal.org/node/425990. Thanks for the hint!  
  > **username_3**: is this useful https://gist.github.com/sunilpawar/e60224369a155b3255db3916fa44383b  
  
  ---
  
  