Made to Order Software Corporation Logo

PHP eFax requires "ssl://" on RedHat EL7

We found out today that RedHat LE7 requires the use of the "ssl://" protocol instead of the default we use of "tls://".

If you have a RedHat server, please make sure to edit the http_request.php file and search for "tls:". Then replace it with "ssl:".

The TLS protocol is defined in RedHat, but somehow it looks like PHP does not define it. The stream_socket_client() function returns immediately with an $errno = 0 and $errstr = "" and absolutely no other indications to what is wrong when that happens.

So in our PHP eFax, you need to do that edit if you run on RedHat LE7 to get things to work. We could look into a way to make things work automatically, but at this point asking you to do that small edit is the safest way to make sure we do not break other people's installations.

There is the current original code (v1.10+):

// the "tls://" may need to be replaced by "ssl://" on some
// systems if $s is NULL after the call to stream_socket_client()
// (i.e. RedHat EL7 still requires "ssl://")
//
$context = stream_context_create();
$s = stream_socket_client('tls://' . $server['host'] . ':' . $server['port'], $errno, $errstr, 60, STREAM_CLIENT_CONNECT, $context);

Edit the last line so it looks like this:

$s = stream_socket_client('ssl://' . $server['host'] . ':' . $server['port'], $errno, $errstr, 60, STREAM_CLIENT_CONNECT, $context);

Then you should be able to send faxes just like that.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.