title: Python paho-mqtt Connect to MQTT broker
body: <p>I'm using this python script to implement a Paho(MQTT) subscriber but i am unable get any responce messages.i am able to subscribe mqtt brokerin command prompt by using <code>mosquitto_sub -t "" -d -h -p 8883 --psk foo --psk-identity bar --insecure --tls-version tlsv1</code></p>
  
  <pre><code>import paho.mqtt.client as mqtt
  
  def on_connect(client, userdata, flags, rc):
      print("Connected with result code "+str(rc))
  
      # Subscribing in on_connect() means that if we lose the connection and
      # reconnect then subscriptions will be renewed.
      client.subscribe("*********")
  
  def on_message(client, userdata, msg):
      print(msg.topic+" "+str(msg.payload))
  
  client = mqtt.Client()
  client.on_connect = on_connect
  client.on_message = on_message
  
  client.connect("*********", 8883, 60)
  
  client.loop_forever()
  </code></pre>
  
  <p>When I run above python script then it does not respond any error or message but keep going with loop , I also run it line by line and when I run <code>client.connect("*********", 8883, 60)</code> then it shows only <strong>0</strong> . please note here without psk and psk-identity we cannot connect to broker.</p>
  
  <p>Thanks</p>