Connecting using client certificates
Closed this issue · 1 comments
woodsandwalker commented
Can you add in a config option to allow for client certificate and private key as per http://www.steves-internet-guide.com/creating-and-using-client-certificates-with-mqtt-and-mosquitto/
The solution is to pass the two files, along with the CA cert, to the stream_context_create()
function in file /src/MqttService.php
line 69, e.g.
$socketContext = stream_context_create(["ssl" => [
"verify_peer_name" => true,
"cafile" => $this->cafile,
"local_cert" => $this->localcert,
"local_pk" => $this->localpk
]]);
salmanzafar949 commented
Will work on it as soon as i get time.
or you can make pr for this if you have time.