XMPPFramework
XMPPFramework copied to clipboard
Secure Transport issue
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
any idea??
Regards!!! :)
I solved the problem with this (https://github.com/robbiehanson/XMPPFramework/issues/793)]
add this un the info.plist
<key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>localhost</key> <dict> <key>NSTemporaryExceptionAllowsInsecureHTTPSLoads</key> <false/> <key>NSIncludesSubdomains</key> <true/> <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSTemporaryExceptionMinimumTLSVersion</key> <string>1.0</string> <key>NSTemporaryExceptionRequiresForwardSecrecy</key> <false/> </dict> </dict> </dict>
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)
}`