title: How to connect to a MQTT broker over SSL / TLS?
body: <p>I am using <a href="https://www.cloudmqtt.com/" rel="nofollow">CloudMQTT</a> as my hosted broker. Everything is working fine on plain MQTT, but when I tried to connect over TLS/SSL it is not working. </p>
  
  <p>I found out that I need to specify the CA certificate files and path to work. 
  On their <a href="https://www.cloudmqtt.com/docs-faq.html#TLS_SSL" rel="nofollow">FAQ page</a> it says that their certificate files are available on most OSs (I am on Windows), but Windows doesn't store the certificates as files, so there is no path to it. I am stuck here. Which files to use?</p>
  
  <p>Anyways I tried this command to subscribe over TLS/SSL (as said in their example)</p>
  
  <pre><code>mosquitto_sub -h [server] -t hello -p 2XXXX -u [username] -P [password] -d --capath /etc/ssl/certs/
  </code></pre>
  
  <p>It says this</p>
  
  <pre><code>Warning: Unable to open socket pair, outgoing publish commands may be delayed.
  Client mosqsub/3740-Jem-PC sending CONNECT
  Error: A TLS error occurred.
  </code></pre>
  
  <p>I also changed the capath and cafile on the mosquitto.conf file.</p>