Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: iLearner on November 18, 2017, 02:20:07 PM

Title: SSL Problem
Post by: iLearner on November 18, 2017, 02:20:07 PM
Hello, I've recently installed SSL certificate on my site however a few thing on index.php are causing it to not work (while it works on pther pages), so here's the problem:
(https://puu.sh/yoLCe/106961f8d8.png)

I have downloaded the whole directory and made a file based search with notepad++ for those lines, however no match at all.
I need to convert those files from http:// to https:// however i can't find them lol
Title: Re: SSL Problem
Post by: a10 on November 18, 2017, 02:47:57 PM
Is "Enable Image Proxy" ticked in Server Settings? If not, enable it and it should fix things.

Continue searching for the links, they must be there somewhere, good to have everything set to https.

But those images are maybe often used on the forum, why not download them and transfer them to your own (https) site, load them from there (just update the links...after finding them:O)
Title: Re: SSL Problem
Post by: iLearner on November 18, 2017, 02:57:54 PM
As I said i cant even find those lines anywhere in my whole folder... I would do if i'd know where they're defined.
Anyway I ticked it, however if i reload the page its again unticked.
(https://puu.sh/yoMTW/0e80ffcdd3.png)

while in settings.php:
$image_proxy_enabled = 1;
Title: Re: SSL Problem
Post by: Shambles on November 18, 2017, 03:19:41 PM
Chances are, those images are members avatars or linked images in their signatures.
Title: Re: SSL Problem
Post by: iLearner on November 18, 2017, 03:21:20 PM
So how do I change them?
Title: Re: SSL Problem
Post by: a10 on November 18, 2017, 03:31:55 PM
... on second thought, the proxy only work on 'img' tags, so you got to find these links. But be sure the proxy works anyway, will be needed sooner or later (test the proxy by posting a http picture).

What I'do (and done in similar situations): download all forum files (may have them already as previously downloaded backup), search relevant folders for text matches, using a very good search program, recommending https://www.mythicsoft.com/agentransack/ which will find anything wherever it may hide.

Edit, good point indeed, if they are signatures, in the db... look in 'smf_members` table and edit it there. Do some good backup along the way :O)
Title: Re: SSL Problem
Post by: Arantor on November 18, 2017, 03:46:11 PM
Avatars should work through the proxy too but mods might not have updated to use the proxy.
Title: Re: SSL Problem
Post by: iLearner on November 18, 2017, 04:05:17 PM
Well i've found all links in database (and changed them) except 1, i can't find this one:
http://mapper-mobile.com/wp-content/uploads/2015/08/mapper-text-logo.png

EDIT: Found and fixed, SSL is working.

One question though: what if a member uses a avatar that links to a http:// site? will i have to edit manually every time?
Title: Re: SSL Problem
Post by: iLearner on November 19, 2017, 05:22:58 AM
Quote from: iLearner on November 18, 2017, 04:05:17 PM
Well i've found all links in database (and changed them) except 1, i can't find this one:
http://mapper-mobile.com/wp-content/uploads/2015/08/mapper-text-logo.png

EDIT: Found and fixed, SSL is working.

One question though: what if a member uses a avatar that links to a http:// site? will i have to edit manually every time?

today i had to change manually once again cause 2 members had avatars with http:// there must be an easier way?
Title: Re: SSL Problem
Post by: Arantor on November 19, 2017, 05:32:57 AM
Without seeing your site, impossible to say.
Title: Re: SSL Problem
Post by: iLearner on November 19, 2017, 05:34:23 AM
https://gta-dayz.com
Title: Re: SSL Problem
Post by: Arantor on November 19, 2017, 05:59:43 AM
I found the link in your screenshot.

The problem is, it's not open to guests therefore I can't see anything.
Title: Re: SSL Problem
Post by: iLearner on November 20, 2017, 08:36:08 AM
I opened it for guests...

I am having to change like on daily bases manually from database the links from http to https...
Title: Re: SSL Problem
Post by: a10 on November 20, 2017, 12:49:17 PM
Quote from: iLearner on November 20, 2017, 08:36:08 AM
I opened it for guests...

I am having to change like on daily bases manually from database the links from http to https...

Is that from new posts \ new members or from older (pre-ssl upgrade) content ?

Edit: I quickly found many http's, example from https://gta-dayz.com/index.php?topic=4088.0
http://sf-cnr.com
http://samp-ac.com
http://i65.tinypic.com/iptiq0.jpg
http://forum.sa-mp.im/download/file.php?avatar=61756_1496951397.jpg
etc

Maybe a complete notepad++ find \ replace http > https will work ?
Title: Re: SSL Problem
Post by: iLearner on November 20, 2017, 03:21:37 PM
its just members using some http:// websites for their avatars mostly.
Title: Re: SSL Problem
Post by: Illori on November 20, 2017, 03:23:58 PM
if the image image proxy is enabled then it will take care of that. is the image proxy enabled?
Title: Re: SSL Problem
Post by: iLearner on November 22, 2017, 08:13:05 AM
It is set to enabled in settings.php however on forum board it is not ticked (if i tick and reload page its unticked again)
Title: Re: SSL Problem
Post by: Illori on November 22, 2017, 08:14:30 AM
are you using 2.0.14 or 2.0.15? if you are not using 2.0.15 please upgrade and try again.
Title: Re: SSL Problem
Post by: iLearner on November 22, 2017, 11:54:11 AM
I've upgraded, let's see what happens.
Title: Re: SSL Problem
Post by: Illori on November 22, 2017, 11:55:25 AM
can you enable the image proxy now?
Title: Re: SSL Problem
Post by: a10 on November 23, 2017, 05:51:55 AM
Yes, test the proxy and be sure it's working.

Got a perfect working proxy on my forum, but anyway did (for fun) a http 'cleanup' in smf_members table. phpmyadmin, Export (with drop\create table set), open in notepad++ find\replace http > https, save, Import.

Rectified a few thousands non-ssl links, just a few minutes work all in all (can probably be done directly in phpmyadmin as well). As always, backup db before doing anything.
Title: Re: SSL Problem
Post by: iLearner on November 23, 2017, 07:43:24 AM
Same behaviour, I tick the image proxy thing and it unticks again.

Also I verified that its actually not working (e.g: https does not work on private messages page)

a10: Yes I did, but members eventually update their avatars again... I can't do that every time nor I think I am supposed to
Title: Re: SSL Problem
Post by: a10 on November 23, 2017, 08:36:55 AM
Quote from: iLearner on November 23, 2017, 07:43:24 AM
I can't do that every time nor I think I am supposed to
Indeed, fixing links was just an experiment. So the image proxy is definitely not active, am supposing you click 'save' after doing the settings, got free space on the server, and set a good size (just to get all that out of the equation). & in ftp any cache folder in the forum directory?
Title: Re: SSL Problem
Post by: LiroyvH on November 23, 2017, 09:02:12 AM
Quote from: iLearner on November 23, 2017, 07:43:24 AM
Same behaviour, I tick the image proxy thing and it unticks again.

Also I verified that its actually not working (e.g: https does not work on private messages page)

a10: Yes I did, but members eventually update their avatars again... I can't do that every time nor I think I am supposed to


Please try it twice in succession.
Title: Re: SSL Problem
Post by: iLearner on November 23, 2017, 09:53:44 AM
I am not a scripting expert or something, but i noticed something strange in my settings.php which was:
(https://puu.sh/ys0Is/bf6f7b6118.png)

I removed the ?> ./AnonGhost<p>AnonGhost</p>YOUR DEFACE PAGE HERE =)
and it started working fine.
Title: Re: SSL Problem
Post by: LiroyvH on November 23, 2017, 10:17:46 AM
Well umm... That doesn't look good.
I'd scan your website for (past) compromises...
Title: Re: SSL Problem
Post by: a10 on November 23, 2017, 01:26:15 PM
! remnants of some hack. Good find, congrats with a working ssl \ proxy.
Title: Re: SSL Problem
Post by: iLearner on November 27, 2017, 02:02:16 AM
Hey, I am sorry if I shouldn't reply here and make new thread, but imo it was the best to post here.

I solved the issue above by enabling image proxy, however now there's a problem that images posted with [img] no longer show, I mean there's no image preview.
Title: Re: SSL Problem
Post by: iLearner on November 29, 2017, 08:48:53 AM
bump, any images that are hosted on a http:// site do not view within img tags.
Title: Re: SSL Problem
Post by: Shambles on November 29, 2017, 08:56:58 AM
If you manually load one of the "missing" images in another browser tab, does refreshing the original browser tab then show the image?

Reason for asking is that the original proxy.php was miscoded in a way that prevented uncached images loaded via http:// from showing up, until the browser had cached them elsewhere.
Title: Re: SSL Problem
Post by: iLearner on December 02, 2017, 03:16:26 PM
Still, doesn't fix the problem?
Title: Re: SSL Problem
Post by: Shambles on December 02, 2017, 03:54:52 PM
Can you attach your live current copy of proxy.php to your next post (just so we can check it's ok) ?
Title: Re: SSL Problem
Post by: iLearner on December 02, 2017, 05:12:56 PM
there you go my friend.
Title: Re: SSL Problem
Post by: Shambles on December 02, 2017, 05:47:05 PM
There's an obscure semicolon near the end of your file. Try this.

No guarantees. No promises.
Title: Re: SSL Problem
Post by: lurkalot on December 02, 2017, 05:55:35 PM
Quote from: sǝๅqɯɐɥS on December 02, 2017, 05:47:05 PM
There's an obscure semicolon near the end of your file. Try this.

No guarantees. No promises.

That "obscure" semicolon is present in a fresh install too.  ;)  This is from the SMF 2.0.15 full install zip I just downloaded.  And obviously the large upgrade also.

))) === false ? 1 : null;;
Title: Re: SSL Problem
Post by: Arantor on December 02, 2017, 06:30:32 PM
The extra semicolon should be perfectly legal, if weird.
Title: Re: SSL Problem
Post by: Shambles on December 03, 2017, 09:49:41 AM
Quote from: iLearner on December 02, 2017, 05:12:56 PM
there you go my friend.

Ok, can you try this version?

Title: Re: SSL Problem
Post by: Aleksi "Lex" Kilpinen on December 22, 2017, 12:37:34 AM
Hi, is this still an issue? Have you tried the suggestions given? :)