Page 1 of 1
[solved] CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 18, 2017 5:51 pm
by deactivated010521
I was trying to add some News message with status unpublished/draft. I found out that CreateDraftAlertTask (Background Job Manager : News\CreateDraftAlertTask) was not triggered correctly on a site running SSL.
Admin Log:
CmsJobManager Received 400 response when trying to trigger async processing
On CmsJobManagerModule.php the $scheme is set to 'https' but the $prefix_scheme always stays null.
Code: Select all
$scheme = $url_ob->get_scheme();
$prefix_scheme = null;
if( !$scheme ) {
$url_ob->set_scheme('http');
$scheme = 'http';
if( CmsApp::get_instance()->is_https_request() ) {
$url_ob->set_scheme('https');
$scheme = $prefix_scheme = 'ssl://';
}
}
....
try {
$fp = fsockopen($prefix_scheme.$url_ob->get_host(),$url_ob->get_port(),$errno,$errstr,3);
Sites running https:// needs more testing.
BTW tryed this out with a self-signed SSL certificate first but it also happened on a live site with valid LetÅ› Encrypt Certificate.
Re: CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 18, 2017 6:37 pm
by calguy1000
I just added some debug statements, and tested this on a server with a letsencrypt certificate. it worked here.
Looking at the code, the only way that prefix_scheme would not be set on an HTTPS request is if the CmsApp::is_http_request() method returned FALSE.
That function is quite simple, and has been unchanged for years.
Code: Select all
public function is_https_request()
{
if( isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off' ) return TRUE;
return FALSE;
}
so, that tells me that there is something non-standard about your environment.
Can you (when using an HTTPS request) debug your $_SERVER variable.
Code: Select all
<pre>{$smarty.server|@print_r}</pre>
will work in any content page.
Re: CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 18, 2017 6:52 pm
by calguy1000
Correction...
I've found a logic error, and fixed that routine. Testing now.
Re: CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 18, 2017 7:00 pm
by deactivated010521
Okey great.
- function is_https_request gives TRUE at my side.
- do not see anything strange when outputing: {$smarty.server|@print_r}
Will test on svn trunk also.
Re: CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 18, 2017 7:15 pm
by deactivated010521
Seems to work while testing at revision 11179:
Admin log shows:
CmsJobManager Processed Job News\CreateDraftAlertTask
And the alert is showing up:
Unapproved News articles
You have 3 that is/are not published
Ad1) After publishing the 3 articles the CmsJobManager triggered again but the alert was not cleared out. Not sure if this is the correct behaviour.
arnoud CmsJobManager Found nothing to do 18 Mar. 2017 20:17:25
CmsJobManager Processed Job News\CreateDraftAlertTask 18 Mar. 2017 20:14:03
Re: CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 18, 2017 7:35 pm
by calguy1000
The alerts do not clear out by themselves. You have to manually clear them.
Re: [fixed] CmsJobManager on SSL/HTTPS website
Posted: Sun Mar 19, 2017 6:52 pm
by deactivated010521
Correct the alerts can be cleared out manually.
Something weird again while looking at the JobManager with Rev 11184.
I placed a few news items to draft mode again but I only get a 302 response code in the Admin Log's:
Code: Select all
192.168.2.16 arnoud CmsJobManager Received 302 response when trying to trigger async processing
Should I do a fresh installation and or are you still working on background job stuff? See "ReduceAdminlogTask" added.
Re: [open] CmsJobManager on SSL/HTTPS website
Posted: Tue Mar 21, 2017 9:35 pm
by calguy1000
A 302 issue probably has more to do with your configuration than with the job manager stuff.
Do you have a mixed http/https site? these days that's probably a bad idea. On the frontend are some pages secure, and others not?
Re: [open] CmsJobManager on SSL/HTTPS website
Posted: Tue Mar 21, 2017 9:42 pm
by calguy1000
Also check your .htaccess for rewrite rules.
CMSMS will use the default pageid when building the action url for the asynchronous processing. If for some reason your site is setup so that every access to the default URL of your site results in a 302 then that would also cause the issue you are seeing.
Re: [open] CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 25, 2017 12:06 pm
by deactivated010521
I tested with a clean cmsms-beta installation without pretty_urls or .htaccess modifications. Will dig into this a bit deeper (print stuff to the admin log) for verification.
Will get back on this later.
Re: [open] CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 25, 2017 2:50 pm
by calguy1000
On my brand new 2.2-beta2 install on HTTPS it works as expected (Including CmsJobManager).
I tested this morning, yesterday we played with certificates and IPv6 configuration because we were having lots of problems on the CMSMS servers.
Re: [open] CmsJobManager on SSL/HTTPS website
Posted: Sat Mar 25, 2017 8:01 pm
by deactivated010521
https on cmsmadesimple.org domains looks good. Last week I spotted problems on my ipad and android phone these are solved.
This item can be closed. I did a fresh installation from Rev: 11193 and I don't see anything weird with the jobmanager.
Thank you for your attention.