XMPPFramework icon indicating copy to clipboard operation
XMPPFramework copied to clipboard

Secure Transport issue

Open dan085 opened this issue 4 years ago • 1 comments

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 avatar Jun 05 '20 19:06 dan085

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)
}`

dan085 avatar Jun 06 '20 18:06 dan085