Error from script unable to connect to tlsv1.2

Maria Abdullah

Sep 27, 2019
cPanel Access Level
Website Owner
I am developing website that will acquire data from a broker.
require "phpMQTT.php";
$mqtt = new phpMQTT("", 8883,
"Emoncms feed subscriber",'ca.crt');
if(!$mqtt->connect(true, NULL, $username, $password)) {
echo "Not connected";
echo "connected";
I am using this code on my localhost. On that it is working fine. But when i uploaded it on cpanel it is not connecting to the broker.
PHP Warning: stream_socket_client(): unable to connect to tlsv1.2:// (Connection refused) in /home/k43irmix6/public_html/phpMQTT.php on line 88
When i was working on xamp it was giving same error and i solved it by adding .crt file of apache and i uploaded the same file on cpanel. But i on cpanel i dont have any idea why it is not connecting.
Your kind help is needed. Thanks in advance.
Last edited by a moderator: