novastone-media / MQTT-Client-Framework

iOS, macOS, tvOS native ObjectiveC MQTT Client Framework
Other
1.84k stars 463 forks source link

Unable to connect to server #556

Closed liliangke555 closed 4 years ago

liliangke555 commented 4 years ago

<! -- before you submit a question, search for existing questions (open and close) to see if your report is likely to repeat -- >

Short description

<! -- I want to know the reason for the error MQTTSession] mqttTransport didFailWithError Error Domain=NSOSStatusErrorDomain Code=-9807 "(null)" UserInfo={_kCFStreamErrorCodeKey=-9807, _kCFStreamErrorDomainKey=3}--> The environment of <! -- tell us the environment -- > -Operating system: IOS -Software version: IOS 13.4 -Mqtt client version: 0.15.4

Link to log

[MQTTSession] mqttTransport didFailWithError Error Domain=NSOSStatusErrorDomain Code=-9807 "(null)" UserInfo={_kCFStreamErrorCodeKey=-9807, _kCFStreamErrorDomainKey=3}

Copy steps

Is there any way to ignore certificate validation

[self.session connectTo:self.mqttSettings[@"host"] port:[self.mqttSettings[@"port"] intValue] tls:[self.mqttSettings[@"tls"] boolValue] keepalive:60 clean:true auth:true user:self.mqttSettings[@"userId"] pass:self.mqttSettings[@"password"] will:false willTopic:@"" willMsg:nil willQos:MQTTQosLevelAtMostOnce willRetainFlag:false withClientId:clienId securityPolicy:nil certificates:nil protocolLevel:MQTTProtocolVersion311 connectHandler:^(NSError *error) { NSLog(@"连接错误----%@",error); }];