1

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.

1 Answer 1

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';
3
  • 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.
    – Alan Dixon
    Dec 12, 2023 at 19:47
  • 1
    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.
    – Alan Dixon
    Dec 12, 2023 at 19:47
  • 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!
    – Josh
    Dec 14, 2023 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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