title: How to connect MQTT on HTTPS server?
body: <p>We are facing the issue in MQTT connection in HTTPS server. Sometimes it is working fine and sometimes it is getting an error like below.</p>
  
  <p>WebSocket connection to 'wss://MYHOST:8083/mqtt' failed: Error in connection establishment: net::ERR_INSECURE_RESPONSE</p>
  
  <p><strong>Let me share with you,</strong></p>
  
  <p><strong>My mosquitto.conf file:</strong></p>
  
  <pre><code>pid_file /var/run/mosquitto.pid
  persistence true
  persistence_location /var/lib/mosquitto/
  log_dest file /var/log/mosquitto/mosquitto.log
  include_dir /etc/mosquitto/conf.d
  listener 1883
  
  
  listener 8083 
  protocol websockets
  certfile /etc/mosquitto/certs/myhost.crt
  cafile /etc/mosquitto/certs/ca.crt
  keyfile /etc/mosquitto/certs/myhost.key
  </code></pre>
  
  <p><strong>My Mosquitto WebSocket config file:</strong></p>
  
  <pre><code>host = 'MYHOST'; // hostname or IP address 
  port = 8083;
  topic = 'TOPIC'; // topic to subscribe to
  useTLS = true;
  username = "";
  password = "";
  path = "/mqtt";
  cleansession = true;
  </code></pre>
  
  <p>Please give me solution for this.</p>
  
  <p>Thanks!</p>
  
  <p>Regards,
  Karmdip Joshi</p>