MQTTCFSocketTransport *transport=[[MQTTCFSocketTransport alloc]init];
transport.host=MQTT_host;
transport.port=MQTT_port;
//這一句關(guān)鍵
transport.tls=YES;
self.mqttSession = [[MQTTSession alloc] init];
_mqttSession.transport=transport;
_mqttSession.delegate=self;
[_mqttSession setUserName:MQTT_userName];
[_mqttSession setPassword:MQTT_pwd];
[_mqttSession connectAndWaitTimeout:10];