How do I get SSL working?

Having trouble installing serendipity?
Post Reply
schimanke
Regular
Posts: 161
Joined: Mon Jan 07, 2008 4:38 pm
Location: Hameln, Germany
Contact:

How do I get SSL working?

Post by schimanke »

Hi there,

I have a problem that I was not able to solve yet. I have requested a SSL-certificate from my hoster. So far everything went fine. The problem is that the links to my CSS-files are set to http instead of https. That is why my blog is not displayed the way it should. You can compare that here: http://www.schimanke.com and https://www.schimanke.com. Now I wonder if there was a way to get both versions working and looking the same way. What do I have to do to accomplish that? Any ideas?

Thanks in advance,
Flo
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How do I get SSL working?

Post by garvinhicking »

Hi!

You can change your s9y configuration and set https:// as your base URL. Or you can enable the option "Autodetect HTTP hostname" that will automatically use HTTPs when you use that URL to enter your blog.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
schimanke
Regular
Posts: 161
Joined: Mon Jan 07, 2008 4:38 pm
Location: Hameln, Germany
Contact:

Re: How do I get SSL working?

Post by schimanke »

Hi Garvin,

that is what I already tried. Unfortunately the changes in base URL are not saved when I click the save-button though s9y tells me it was saved. But when I enter the configuration page again the base URL is set back to http://. Therefore the link to my CSS-files is still set to "http://www.schimanke.com:443/index.php?/serendipity.css" when entering the site via https://. Could that be a bug? What can I do? Would you like to take a look at my installation?

Thanks for your help!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How do I get SSL working?

Post by garvinhicking »

Hi!

That should not happen; which browser and which s9y version are you using? HAve a look inside the HTML sourcecode of the config page and see if the "selected" attribute really is not set for the option you set.

Anyhow. I tried your page, when I use "http://schimanke.com" the CSS is properly linked to that domain. So I figure the option IS properly enabled, but https:// is not properly prefixed to your domain. Which webserver are you using? Lighttpd might not set the $_SERVER['HTTPS'] option that is required for s9y to detect whether HTTPS is used or not.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
schimanke
Regular
Posts: 161
Joined: Mon Jan 07, 2008 4:38 pm
Location: Hameln, Germany
Contact:

Re: How do I get SSL working?

Post by schimanke »

I am using s9y 1.4 and Firefox 3.0.7. When I look at the source code of the config page it also tells me that the base URL is set to http:// and NOT to https:// as I have entered it. So it seems that the config changes are not saved.

Yes, http://schimanke.com and http://www.schimanke.com work absolutely fine. The problem only occurs when using SSL. The blog is hosted at 1&1 and the webserver should be apache, which you can see here: http://www.schimanke.com/info.php

Regards,
Flo
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How do I get SSL working?

Post by garvinhicking »

Hi!

Your info.php reveals that $_SERVER['HTTPS'] is not set. S9y requires this field to be set (to the value "On" or "on"); usually Apache1+2 do set that env field. I cannot tell you why your server doesn't, maybe you can ask your technical support? This is really standard and is required for proper https usage.
schimanke wrote:I am using s9y 1.4 and Firefox 3.0.7. When I look at the source code of the config page it also tells me that the base URL is set to http:// and NOT to https:// as I have entered it. So it seems that the config changes are not saved.
Hm, changes should be saved when you get no error message. The actual values are stored in the serendipity_config database table.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
schimanke
Regular
Posts: 161
Joined: Mon Jan 07, 2008 4:38 pm
Location: Hameln, Germany
Contact:

Re: How do I get SSL working?

Post by schimanke »

Okay, thank you! I will contact tech support at 1&1. Maybe they can solve this issue. I'll keep you up to date.

Anyway, the base URL settings are definatley not saved. The database still says http://. I tried to change it via phpMyAdmin directly but to no success. The database noe says https:// but on the config page is still http://. The page is still not diplayed properly with SSL.

Any more ideas?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How do I get SSL working?

Post by garvinhicking »

Hi!

Yeah, when you use the "Autodetect HTTP-Host" option, this will always overwrite your hostname with non-SSL, due to your $_SERVER['HTTPS'] variable not being set. Only if you disable "Autodetect HTTP-Host", s9y exactly shows you the one hostname you configured.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
schimanke
Regular
Posts: 161
Joined: Mon Jan 07, 2008 4:38 pm
Location: Hameln, Germany
Contact:

Re: How do I get SSL working?

Post by schimanke »

Okay, there we have it. Thanks Garvin! Now it works with http:// as well as with https://. I set the the "Autodetect HTTP-Host" option to "no" and the base URL to https:// and now everything is working just fine. Thanks again!
Post Reply