Page 1 of 1

PHP Warning: fsockopen(): Failed to enable crypto

Posted: Mon Jan 08, 2018 5:08 pm
by sweboy
Hi!

After enabled the cert (SSL) in my virtual host webbserver on Linux Mint I get the below message when I open the "Module Manager" in the admin panel - "A problem occurred communicating whit the module server". Is it that the CMS can't use SSL internally for "Module Manager"? Or have I missed something? :)

PHP Warning: fsockopen(): unable to connect to ssl://www.domain.com:443 (Unknown error) in /var/www/html/modules/CmsJobManager/CmsJobManager.module.php on line 300, referer: http://www.domain.com

PHP Warning: fsockopen(): Failed to enable crypto in /var/www/html/modules/CmsJobManager/CmsJobManager.module.php on line 300 referer: http://www.domain.com

Br Daniel

Re: PHP Warning: fsockopen(): Failed to enable crypto

Posted: Wed Jan 10, 2018 8:56 am
by jce76350
I have the same error on a local server at the login page
PHP 7.0.27-0+deb9u1 + apache/2.4.25 (debian) linux 4.9.0-5-amd64 on x86_64

Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in .../modules/CmsJobManager/CmsJobManager.module.php on line 300

Warning: fsockopen(): Failed to enable crypto in ....modules/CmsJobManager/CmsJobManager.module.php on line 300

Warning: fsockopen(): unable to connect to ssl://localtracfoil.com:443 (Unknown error) in .../modules/CmsJobManager/CmsJobManager.module.php on line 300

Re: PHP Warning: fsockopen(): Failed to enable crypto

Posted: Thu Jan 11, 2018 4:01 pm
by sweboy
In my install of CMSMS 2.2.5 on a Linux Mint host, I made some changes
to this file:
/var/www/html/modules/CmsJobManager/CmsJobManager.module.php
since it showed up several times in the Apache error.log.

Code: Select all


And since my site has an Apache RewriteRule for visitors so they will
always use https, I had to make an exception for localhost, which is
the third line in this rewrite config:

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !=localhost
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

This way CMSMS won't try to use https when making "loopback"
connections. There could be another (better) way to make it work but
I'm happy so far... hope it won't affect system security too much.

Re: PHP Warning: fsockopen(): Failed to enable crypto

Posted: Thu Jan 11, 2018 5:47 pm
by paulbaker
sweboy, your post had a code hack which is not allowed in the forum, see section 14 of
viewtopic.php?f=40&t=76470

The code hack has been removed from your post. Thank you for your understanding.