robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

Secure Transport issue #1171

Open dan085 opened 4 years ago

dan085 commented 4 years ago

hello I have this problem I use port 5223 with certificate

Optional(Error Domain=kCFStreamErrorDomainSSL Code=-9807 "(null)" UserInfo={NSLocalizedRecoverySuggestion=Error code definition can be found in Apple's SecureTransport.h})

App Transport Security Settings in the project

In info.plist

Captura de Pantalla 2020-06-05 a la(s) 15 24 03

any idea??

Regards!!! :)

dan085 commented 4 years ago

I solved the problem with this (https://github.com/robbiehanson/XMPPFramework/issues/793)]

add this un the info.plist

`NSAppTransportSecurity

NSExceptionDomains localhost NSTemporaryExceptionAllowsInsecureHTTPSLoads NSIncludesSubdomains NSTemporaryExceptionAllowsInsecureHTTPLoads NSTemporaryExceptionMinimumTLSVersion 1.0 NSTemporaryExceptionRequiresForwardSecrecy ` **and add this inside code the project** ` func xmppStream(_ sender: XMPPStream, willSecureWithSettings settings: NSMutableDictionary) { print("=====willSecureWithSettings") settings.setObject(true, forKey:GCDAsyncSocketManuallyEvaluateTrust as NSCopying) }` ` func xmppStream(_ sender: XMPPStream, didReceive trust: SecTrust, completionHandler: ((Bool) -> Void)) { completionHandler(true) }`