Show security warning

Show security warning

An sree發表於
Number of replies: 10

Hi,

I have used moodle 1.9 version. 

I am already installed SSL in my website and force the site to https but now its showing some security warning like its still loading some insecure images. I think we can easily fix this issue by clearing cashing on Moodle latest versions. But, here it  is an outdated moodle 1.9 version and we cannot clear cashes directly through admin panel. Please anyone help me . How can i fix this warning in moodle 1.9 version. 


Thanks in advance.

評比平均分數: -
In reply to An sree

Re: Show security warning

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片

Firstly - please update your profile to show your correct name. We are all 'Moodle User'. We'd like to know who we are talking to 眨眼


It sounds like you have mixed content issues. Modern browsers will not accept links to non-ssl sites from an ssl site. Make sure all your links in content are https://

There are now tools to deal with this but not back in 1.9 days. 

In reply to Howard Miller

Re: Show security warning

An sree發表於

Hi Howard Miller,

Thanks for your response. As per your request I have updated my profile. My name is An Sree. I am a beginer in moodle technology. Three images are loading with http instead of https. But I can't find out the source of those images. It is loaded by the url like http://mysite/file.php/1/screenshot.jpg. I could find this on mdl_cashe_text table. But the data get updated while the site running.

In reply to An sree

Re: Show security warning

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片

Unfortunately, I have no recollection how caching works on 1.9

If caching is the problem. 

In reply to Howard Miller

Re: Show security warning

An sree發表於

I am not sure is it cashing issue or not.. 

Please anyone help me to find out the solution for this issue

In reply to An sree

Re: Show security warning

Ken Task發表於
Particularly helpful Moodlers的相片

It's been many years ... so this is from 'best recollection' ...

See the '1' in the URL to the image?

That file should be a directory in /moodledata/1/ ...  the directory for all files related
to your 1.9 front page.   Verify that file is there.

Can you turn on editing on the front page and see if the image is in the site
summary?   If so, download the image first, then remove it and save.   The re-edit the summary and upload. Now it will reference the image using https.

For each image that causes the mixed content issue, one needs to do the same as described above.

If that's too many to do one at a time, the only other way is to take a mysqldump of
the database.  The sql file is asciii so one can edit it via any ASCII editor .... *NOT
MS Word other other word processor*.
Search for http://yoursite/ replace with https://yoursite/ in the entire sql file.  Note again that's changing http to https.  And you want to use the full URL for your site with the ending '/'  to avoid globally changing other URL's that might be in the SQL file.

Then in the mysql client, create a new db for the moodle (call it something like moodle2), use the edited sql file to import into that new moodle2 db.

Last step edit config.php to point to moodle2 DB.

Before doing all that ... 

Version 1.9 didn't have a purge cache.  But, *if* site is using a PHP accelerator ... which was recommended back then ... you might be able to run an opache php script to refresh what caching it's doing.   From command line, php -m might show if an accelerator extension is installed.

https://www.stevejenkins.com/blog/2014/07/my-favorite-zend-opcache-status-scripts/

The OCP – OPcache Control Panel in above does have a 'Reset'.

That's a separate script ... not a moodle plugin/extension/mod etc.
Just upload to the root of the moodle code and access directly with browser.

Once you are done converting, move the script out of web root ... save it somewhere else on server ... like in /root ... that's because anyone discovering the script is there can use it.

Needless to say, 1.9 is very old and it would be wise to think about how to upgrade that site.

'spirit of sharing', Ken


In reply to An sree

Re: Show security warning

AL Rachels發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片

When you switch your Moodle 1.9 to using https you need to run the replace tool to change all http:// to https://

You can do that by going to https://yourmoodle/admin/replace.php

In the, Search whole database for: enter http://

In the, Replace with this string: enter https://

Click, Yes do it now.

This should fix many of your link problems, but it still may not make all the changes you need.

In reply to AL Rachels

Re: Show security warning

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片

If these are *external* links, this only works if they support https. 

These days it's probably worth a go regardless but the OP may end up with some broken links. 

In reply to AL Rachels

Re: Show security warning

Ken Task發表於
Particularly helpful Moodlers的相片

Al ... you've got a better memory than most! 微笑

An Sree ... use what Al said! 微笑

Just one additional suggestion ... make a backup of your database before using any conversion method ... just in case.

'spirit of sharing', Ken


In reply to Ken Task

Re: Show security warning

AL Rachels發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
Ken...not a better memory...just a bunch of Odroid's and Raspberry Pi's, which allows me to keep any version of Moodle I want to. Currently have 1.9.19 thru 3.6rc2. When a question like this comes up, I turn on the right small board computer and verify.