Results 1 to 6 of 6

Thread: Forcing https?

  1. #1
    jimatbes is offline Sugar Community Member
    Join Date
    Sep 2005
    Posts
    19

    Default Forcing https?

    How can I force Sugar to use https?

    Didn't see any flag in the config file or option anyplace.

  2. #2
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Talking Re: Forcing https?

    Quote Originally Posted by jimatbes
    How can I force Sugar to use https?

    Didn't see any flag in the config file or option anyplace.
    It would be more of a server thing than a Sugar thing. If you have SSL activated on your server and your config file is right Sugar should work in https without change. You may have to change the site URL in your config.php file.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  3. #3
    jimatbes is offline Sugar Community Member
    Join Date
    Sep 2005
    Posts
    19

    Default Re: Forcing https?

    Thanks for the quick reply!

    Will the following in config.php force the use of https, preventing access with http (i.e., ensuring encrypted communications always)?

    Code:
       array (
     	'persistent' => true,
     	'autofree' => false,
     	'debug' => 0,
     	'seqname_format' => '%s_seq',
     	'portability' => 0,
     	'ssl' => true,
       ),
     
     ...
     
       'site_url' => 'https://mysite.com/sugar_directory',

  4. #4
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: Forcing https?

    Those are both valid settings, but again, forcing SSL should be done at the server level not the program level. If you want no access to Sugar on port 80 either turn off port 80 (http) or configure your server not to allow non-ssl access to the Sugar directory.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  5. #5
    tdp
    tdp is offline Sugar Community Member
    Join Date
    Sep 2005
    Posts
    74

    Default Re: Forcing https?

    If you are using Apache, you can use mod_rewrite to force any http connections to https. Here is an example virtual host that redirects to https:

    <VirtualHost *:80>
    ServerName mysugar.domain.com
    DocumentRoot /path/to/Sugar
    RewriteEngine on
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
    </VirtualHost>

  6. #6
    grimlock is offline Junior Member
    Join Date
    Jul 2008
    Posts
    4

    Default Re: Forcing https?

    Here's the way I configured sugar to work with SSL. I modified index.php in the root of my sugar install and right below the copyright notice I add the following.

    PHP Code:
    // Added for SSL Connection by Grimlock  
    if ($_SERVER['SERVER_PORT'] != 443) { header("Location: https://www.mywebsiteurl.com/sugar"); exit; }  // 
    And you have to also update your config.php URL as you have so emails from Sugar will be sent out properly.

    One reason I've removed this is because Sugar was super slow since it reloads images, JavaScript files and CSS files when SSL is forced.

    Good luck!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •