CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • HTTPS detection not working after 2.0 upgrade
Pages: [1]

Author Topic: HTTPS detection not working after 2.0 upgrade  (Read 2342 times)

jcm55

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 14
HTTPS detection not working after 2.0 upgrade
March 15, 2008, 10:20:39 am
Just upgraded to CiviCRM 2.0.  Everything went smoothly, except now CiviCRM is warning me "HTTPS is not set up on this machine."  If I go into Admin -> Global Settings -> Resource URLs, I see that "Force Secure URLs" is set to "Yes", but if I try to save those settings, I get an error "You need to set up a secure server before you can enable SSL."

SSL is set up and working for the site -- has been for a while, and was working fine in CiviCRM 1.9.  If I manually change the URL to "https://..." in the address bar of my browser and go into Admin, then the "HTTPS is not set up on this machine" warning disappears, but I still get the other error in the Resource URLs page.  Also, Contribution pages are not work (same "SSL not enabled" error).

I see that there is a CRM_Utils_System::checkURL method that gets called to verify that https is working, but I'm unclear why that check would be failing.  I can visit any https URL on the site in my browser and it works fine.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: HTTPS detection not working after 2.0 upgrade
March 15, 2008, 10:30:51 am

Can you instrument the code there and check the access logs to see what HTTP code is being returned (i suspect its not 200). We use the PEAR Request library to fetch a page and ensure that SSL is working

It works locally for us, so kinda hard to debug this issue on our side

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jcm55

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 14
Re: HTTPS detection not working after 2.0 upgrade
March 15, 2008, 10:42:14 am
You are right -- apache is returning 403 for the HEAD requests sent by PEAR/checkURL.  I don't understand why that's the case, because you can see a couple of GET requests from my browser which work fine.


199.5.xxx.xxx - - [15/Mar/2008:10:13:40 -0700] "HEAD /db/ HTTP/1.1" 403 - "-" "PEAR HTTP_Request class ( http://pear.php.net/ )"
199.5.xxx.xxx - - [15/Mar/2008:10:13:41 -0700] "HEAD /db/ HTTP/1.1" 403 - "-" "PEAR HTTP_Request class ( http://pear.php.net/ )"
76.102.xxx.xxx - - [15/Mar/2008:10:34:41 -0700] "GET /db/ HTTP/1.1" 302 - "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"
76.102.xxx.xxx - - [15/Mar/2008:10:34:42 -0700] "GET /db/civicrm/dashboard?reset=1 HTTP/1.1" 200 12436 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: HTTPS detection not working after 2.0 upgrade
March 15, 2008, 10:51:08 am

can u investigate further and do a couple of yahoo! searches on why head/get are returning different codes.

you might also want to try switching to GET instead of HEAD and see if that fixes the issue

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jcm55

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 14
Re: HTTPS detection not working after 2.0 upgrade
March 15, 2008, 12:32:11 pm
Okay, figured it out.  I have Drupal access control set so that only authenticated users can access CiviCRM, and I also had the Drupal front page set to /civicrm.  We don't have any content in Drupal other than CiviCRM, so this made sense to me.  With this config, unauthenticated users are prompted to log in as soon as they hit the Drupal base URL.

From a web browser, it's not obvious that the "please authenticate" page returned by Drupal is actually a 403 "error page."  So PEAR was getting 403 when it checked the base URL because it wasn't authenticated.  Of course when I visited the same URL in my browser, my session/login was cached and it seemed to be working fine.

Anyway, I set the Drupal front page to something else (which doesn't require authentication), and it's working fine now.  I'm puzzled now how it was working before under CiviCRM 1.9 though.
« Last Edit: March 15, 2008, 12:34:38 pm by jcm55 »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: HTTPS detection not working after 2.0 upgrade
March 15, 2008, 12:42:37 pm

1.9 did not have the checks. in 2.0 we've also put admin under https and expanded the checks to avoid the user getting into a bad situation

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: HTTPS detection not working after 2.0 upgrade
March 30, 2008, 02:11:16 am
We were having the same problem. Come to find out, it was because we had the Drupal site set to offline for maintenance. Once we turned that off, everything was fine.

Just a bit of a pain, since sometimes you need to be able to take down the site for maintenance on CiviCRM.

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Re: HTTPS detection not working after 2.0 upgrade
June 27, 2008, 03:10:12 pm
Quote
Come to find out, it was because we had the Drupal site set to offline for maintenance. Once we turned that off, everything was fine.

Ah ha. That makes sense. Wish I had searched here before banging my head on the desk.
Thanks!
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • HTTPS detection not working after 2.0 upgrade

This forum was archived on 2017-11-26.