title: Mosquitto server conf for using PFX certificate
body: <p>I had been able to get TLS connection with mosquitto and using CA.crt, server.crt, server.key plus client.crt and client.key. I been able to sub and pub no problem using MQTTfx and just command lines. below is my full setting for anyone who needs it, and I am looking for some help to use pfx certs.</p>
  <p>I am asked to figure out how to sub and pub to the broker using PFX client cert(contains client.crt and client.key) along with ca.crt, which I don't see as option to MQTTfx 1.7 or in CMD examples I can find online. Wondering anyone had this experience using PFX that can enlighten me with broker settings and sub examples.</p>
  <p><strong>Broker setting:</strong></p>
  <pre><code>listener 8883
  log_type error
  log_type notice
  log_type information
  log_type debug
  require_certificate true
  use_identity_as_username true
  cafile C:\Program Files\mosquitto\cert\ca.crt
  keyfile C:\Program Files\mosquitto\cert\server.key
  certfile C:\Program Files\mosquitto\cert\server.crt
  </code></pre>
  <p><strong>Subscription command line</strong></p>
  <pre><code>mosquitto_sub -h 192.167.41.17 -t home/garden/fountain --cafile &quot;C:\ca.crt&quot; --cert &quot;C:\client.crt&quot; --key &quot;c:\client.key&quot; -d -p 8883
  </code></pre>
  <p><strong>Certificates used in this project is self signed:</strong>
  <strong>To create CA:</strong></p>
  <pre><code>openssl genrsa -des3 -out ca.key 2048
  
  openssl req -new -x509 -days 1826 -key ca.key -out ca.crt
  </code></pre>
  <p><strong>To create server:</strong></p>
  <pre><code>openssl genrsa -out server.key 2048
  
  openssl req -new -out server.csr -key server.key
  
  openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 360
  </code></pre>
  <p><strong>To create client:</strong></p>
  <pre><code>openssl genrsa -out client.key 2048
  
  openssl req -new -out client.csr -key client.key
  
  openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days 360
  </code></pre>
  <p><strong>To create the pfx:</strong></p>
  <pre><code>openssl pkcs12 -export -out certbag.pfx -inkey client.key -in client.crt -in
  </code></pre>
  <p><img src="https://i.stack.imgur.com/mkcsL.png" alt="MQTTfx settings" /></p>