This Help forum is for issues relates to the latest release (1.7.10/11/12). For issues related to development versions please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

TOPIC: [SOLVED] Not able to log in after installing SSL

Not able to log in after installing SSL 2 months 3 weeks ago #1

  • HRN
  • HRN's Avatar
  • Offline
  • Senior
  • Posts: 318
Logging in after installing SSL certificate only takes me back to login.php
Any clues?
webtrees 1.7.13 at visitusinmaputo.com/webtree PHP 7.2.9 (Modules: vytux_cousins, vytux_pages, fancy_treeview, ancestral-fan-chart)
webtrees 2.0 dev on local WampServer PHP 7.3.1
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 3 weeks ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10844
The "submit" URL for the login form specifies HTTP:// rather than HTTPS://

The two most likely possibilities are:

1) you have specified that address as the "Login URL" setting in the control panel. If so, just remove it.

2) your webserver configuration does not include enough information to tell PHP/webtrees that the request is HTTPS, and hence it is detecting HTTP.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 3 weeks ago #3

  • HRN
  • HRN's Avatar
  • Offline
  • Senior
  • Posts: 318
Thank you for quick response Greg, and Happy New Year!

"Login URL" has never been set in control panel.
However, now setting this to https://XXX//login.php solves the problem temporarily (I understand this will be removed in future versions), until webserver config has been fixed.
webtrees 1.7.13 at visitusinmaputo.com/webtree PHP 7.2.9 (Modules: vytux_cousins, vytux_pages, fancy_treeview, ancestral-fan-chart)
webtrees 2.0 dev on local WampServer PHP 7.3.1
Last Edit: 2 months 3 weeks ago by HRN.
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 3 weeks ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10844
This will only fix logins.

webtrees uses absolute URLs in other circumstances as well.

Now you are logged in, look at the $_SERVER variables in the PHP information page. This is the information that webtrees uses to detect the request URL.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 3 weeks ago #5

  • HRN
  • HRN's Avatar
  • Offline
  • Senior
  • Posts: 318
Thank you Greg
I have not come across other problems than login, but will certainly fix this in server config
webtrees 1.7.13 at visitusinmaputo.com/webtree PHP 7.2.9 (Modules: vytux_cousins, vytux_pages, fancy_treeview, ancestral-fan-chart)
webtrees 2.0 dev on local WampServer PHP 7.3.1
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 3 weeks ago #6

  • HRN
  • HRN's Avatar
  • Offline
  • Senior
  • Posts: 318
My host suggest adding following code to webtrees source code:

// START HTTPS SUPPORT

if ($_SERVER['HTTP_X_PROTO'] != "https") {
header("HTTP/1.1 301 Moved Permanently");
$location = "https://" . $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI];
header("Location: $location");
exit;
}
define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_PROTO'] == 'https') {
 $_SERVER['HTTPS']='on';
}

// END HTTPS SUPPORT 

This is the same fix as for wordpress, and I'm happy with this if it solves my problem. I just have to add it on every upgrade...
To which file should this be added?, includes/sessions.php?
webtrees 1.7.13 at visitusinmaputo.com/webtree PHP 7.2.9 (Modules: vytux_cousins, vytux_pages, fancy_treeview, ancestral-fan-chart)
webtrees 2.0 dev on local WampServer PHP 7.3.1
Last Edit: 2 months 3 weeks ago by HRN.
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 2 weeks ago #7

  • HRN
  • HRN's Avatar
  • Offline
  • Senior
  • Posts: 318
Any advice regarding post above?
webtrees 1.7.13 at visitusinmaputo.com/webtree PHP 7.2.9 (Modules: vytux_cousins, vytux_pages, fancy_treeview, ancestral-fan-chart)
webtrees 2.0 dev on local WampServer PHP 7.3.1
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 2 weeks ago #8

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10844
That code should probably work.

I guess your server (or proxy server) uses non-standard headers to indicate HTTPS requests.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Not able to log in after installing SSL 2 months 2 weeks ago #9

  • HRN
  • HRN's Avatar
  • Offline
  • Senior
  • Posts: 318
Thank you Greg
Where would be the best place to add this code?
webtrees 1.7.13 at visitusinmaputo.com/webtree PHP 7.2.9 (Modules: vytux_cousins, vytux_pages, fancy_treeview, ancestral-fan-chart)
webtrees 2.0 dev on local WampServer PHP 7.3.1
The administrator has disabled public write access.

Not able to log in after installing SSL 2 months 2 weeks ago #10

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10844
As you said, in includes/session.php
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

[SOLVED] Not able to log in after installing SSL 2 months 2 weeks ago #11

  • HRN
  • HRN's Avatar
  • Offline
  • Senior
  • Posts: 318
Once again, thank you!
Problem solved.
webtrees 1.7.13 at visitusinmaputo.com/webtree PHP 7.2.9 (Modules: vytux_cousins, vytux_pages, fancy_treeview, ancestral-fan-chart)
webtrees 2.0 dev on local WampServer PHP 7.3.1
Last Edit: 2 months 2 weeks ago by HRN.
The administrator has disabled public write access.
Powered by Kunena Forum