I have attempted to point my iOS client to a self-signed host on our local network but I keep on getting SSL Error's
I have updated my Info.plist file as follows
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
And added serverTrustPolicies instance to the init of the MooManager which got me passed "https://
INTERNAL.HOST.com/api/auth/token" but it appears i'm still getting the error attached
open class AlamofireService : NSObject {
var privateSession:MooManager?
// Mark: init
override init() {
super.init()
var defaultHeaders = SessionManager.defaultHTTPHeaders
defaultHeaders["User-Agent"] = (defaultHeaders["User-Agent"]! as String) + " mooIOS/1.0"
let configuration = URLSessionConfiguration.ephemeral
configuration.httpAdditionalHeaders = defaultHeaders
let serverTrustPolicies: [String: ServerTrustPolicy] = [
"INTERNAL.HOST.com": .disableEvaluation
]
//privateSession = MooManager(configuration: configuration )
privateSession = MooManager(configuration: configuration, serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) )
}
// Mark: Singleton
class var sharedInstance : AlamofireService {
struct Singleton {
static let instance = AlamofireService()
}
// Return singleton instance
return Singleton.instance
}
}
Add comment comment