I didn't get a response on the Joomla forum, but I have fixed this and thought you'd be interested for reference. Basically it was an SSL validation issue as the server was reporting that it could not validated the certificate chain of the site. What seemed to be happening is during the process the server was making an SSL connection back to itself somehow (I assume rather than telling the browser to) and then the internal server was failing to validate the certificate path. This error was present in the php_error_log:
[22-Nov-2018 06:02:09 Europe/Berlin] PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /opt/lampp/htdocs/WAS-2018/templates/bigbusiness/error.php on line 23
[22-Nov-2018 06:02:09 Europe/Berlin] PHP Warning: file_get_contents(): Failed to enable crypto in /opt/lampp/htdocs/WAS-2018/templates/bigbusiness/error.php on line 23
[22-Nov-2018 06:02:09 Europe/Berlin] PHP Warning: file_get_contents(https://www.waterauditsurveys.com/index.php?option=com_content&view=article&id=67): failed to open stream: operation failed in /opt/lampp/htdocs/WAS-2018/templates/bigbusiness/error.php on line 23
This seems to stem from how linux builds its certificate chain when the issuing CA certificate is not present, and also explains why I didn't have any other SSL problems when browsing the site as browsers do this differently.
A simple way to check this was to run from the servers CLI
curl https://mywebsite
and I got the following error:
curl: (60) SSL certificate problem: unable to get local issuer certificate
Anyhow, the fix was quite simple in the end, I just need to declare the issuing CA certificate file in the Apache host config using the SSLCACertificateFile
option, restarted Apache and it worked!
Hope this helps someone else in the future!