Answers.Body: <p>I guess the first thing is if it's not a production site is it actually ssl-enabled? If not, try running <code>cv ev 'Civi::settings()-&gt;set(&quot;enableSSL&quot;, &quot;0&quot;);'</code> If you don't have cv you can do it directly in the database <code>UPDATE civicrm_setting SET value='s:1:&quot;0&quot;;' WHERE name='enableSSL';</code>. I suppose you could try running that anyway and see if it makes a difference.</p>
  <p>Otherwise do you have a proxy setup? See <a href="https://lab.civicrm.org/dev/core/-/issues/425" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/issues/425</a> where it says this can sometimes give a false message.</p>
  <p>The exact criteria it's using for this error message is:</p>
  <pre><code>if (Civi::settings()-&gt;get('enableSSL') &amp;&amp;
        !self::isSSL() &amp;&amp;
        strtolower($req_headers['X_FORWARDED_PROTO'] ?? '') != 'https'
  
  WHERE self::isSSL() is !empty($_SERVER['HTTPS']) &amp;&amp; strtolower($_SERVER['HTTPS']) != 'off';
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-12T19:47:09.813Z
Answers.Text: I'd vote for the proxy thing. The message says that CiviCRM thinks it's not https, but the chrome extension says it is, and I'd believe chrome (in this case!). So your solution is correct, at least to solve the problem as described.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-12T19:47:15.113Z
Answers.Text: On the other hand, from a quick google, AWS EB is normally ssl-terminated before the the load is balanced, and it makes sense that a change to this infrastructure would have an impact like this. So this is going to impact other things as well, and you will want to tell your CMS and the rest of your code that you're using a proxy so that, for example, you don't report the intermediate ip as the source of the ip. For my infrastructure, I use 'SetEnvIf X-Forwarded-Proto https HTTPS=on' in my .htaccess file, for example.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-14T05:27:04.143Z
Answers.Text: So far the change for SSL is working. Alan,  I think you make a great point about .htaccess and I will do some testing with this. Thanks!
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-12-11T05:30:02.770Z
Answers.LastActivityDate: 2023-12-11T05:30:02.770Z
Answers.UserDisplayName: Demerit
Body: <p>I am running CiviCRM 5.64.3 and I have Drupal 9.5. When trying to get to any admin page the site does 302 redirects until the browser (I have tried multiple) reports too many redirects.</p>
  <p>In my Drupal Watchdog logs I have an error like this:</p>
  <pre><code>CiviCRM thinks site is not SSL, redirecting to {url}
          Array
          (
             [url] =&gt; https://subdomain.domain.org/civicrm/admin/uf/group?reset=1
          )
  </code></pre>
  <p>I have tried clearing caches, upgrading CiviCRM,  many admin pages.  I have verified using the Chrome <a href="https://chromewebstore.google.com/detail/redirect-path/aomidfkchockcldhbkggjokdkkebmdll?pli=1" rel="nofollow noreferrer">Redirect Path</a> extension that all the redirects are from https to https.</p>
  <p>This CiviCRM instance works in our production environment.  We are transitioning to AWS Elastic Beanstalk (EB). The only thing this would impact is the location of our files directory (e.g., sites/default/files/civicrm).  Files are in a remote distributed file system (EFS).  The machine running CiviCRM is the only machine accessing those files.  I do not think this is the issue as CSS and JS files are being downloaded for non /admin pages.</p>
  <p>I also tried upgrading to CiviCRM version 5.67.3 to see if that would fix the problem and it did not.</p>
  <p>I appreciate any help that can be provided.</p>
  
Tags: <drupal><migration>
Title: CiviCRM thinks site is not SSL, redirecting to {url}
ThreadText: # CiviCRM thinks site is not SSL, redirecting to {url}
  
  (Asked by: username_0 on 2023-12-11)
  
  I am running CiviCRM 5.64.3 and I have Drupal 9.5. When trying to get to any admin page the site does 302 redirects until the browser (I have tried multiple) reports too many redirects.
  In my Drupal Watchdog logs I have an error like this:
  CiviCRM thinks site is not SSL, redirecting to {url}
          Array
          (
             [url] => https://subdomain.domain.org/civicrm/admin/uf/group?reset=1
          )
  
  I have tried clearing caches, upgrading CiviCRM,  many admin pages.  I have verified using the Chrome Redirect Path extension that all the redirects are from https to https.
  This CiviCRM instance works in our production environment.  We are transitioning to AWS Elastic Beanstalk (EB). The only thing this would impact is the location of our files directory (e.g., sites/default/files/civicrm).  Files are in a remote distributed file system (EFS).  The machine running CiviCRM is the only machine accessing those files.  I do not think this is the issue as CSS and JS files are being downloaded for non /admin pages.
  I also tried upgrading to CiviCRM version 5.67.3 to see if that would fix the problem and it did not.
  I appreciate any help that can be provided.
  
  **Tags:** drupal, migration
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-12-11. Score: 0
  
  I guess the first thing is if it's not a production site is it actually ssl-enabled? If not, try running cv ev 'Civi::settings()->set("enableSSL", "0");' If you don't have cv you can do it directly in the database UPDATE civicrm_setting SET value='s:1:"0";' WHERE name='enableSSL';. I suppose you could try running that anyway and see if it makes a difference.
  Otherwise do you have a proxy setup? See https://lab.civicrm.org/dev/core/-/issues/425 where it says this can sometimes give a false message.
  The exact criteria it's using for this error message is:
  if (Civi::settings()->get('enableSSL') &&
        !self::isSSL() &&
        strtolower($req_headers['X_FORWARDED_PROTO'] ?? '') != 'https'
  
  WHERE self::isSSL() is !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off';
  
  > **Comments:**
  > **username_2**: I'd vote for the proxy thing. The message says that CiviCRM thinks it's not https, but the chrome extension says it is, and I'd believe chrome (in this case!). So your solution is correct, at least to solve the problem as described.  
  > **username_2**: On the other hand, from a quick google, AWS EB is normally ssl-terminated before the the load is balanced, and it makes sense that a change to this infrastructure would have an impact like this. So this is going to impact other things as well, and you will want to tell your CMS and the rest of your code that you're using a proxy so that, for example, you don't report the intermediate ip as the source of the ip. For my infrastructure, I use 'SetEnvIf X-Forwarded-Proto https HTTPS=on' in my .htaccess file, for example.  
  > **username_0**: So far the change for SSL is working. Alan,  I think you make a great point about .htaccess and I will do some testing with this. Thanks!  
  
  ---
  
  