Hi Team,
We are getting below error when we try to connect our REST APIs from our device. Our application is enterprise application and its connecting all backend calls via MobileIron Secure Tunnel(VPN). We are not encountering this error when we try to connect backend system from Simulator on VPN connected machine. We are calling 13 APIs but we are getting below error intermittently for different APIs i.e each time we are facing this issue for different APIs. We connected with our Helpdesk team to troubleshoot the error and they checked the MobileIron VPN firewall and there is no log
We configured below things
Allow Arbitrary Loads - True
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
We are using Alamofire library to connect backend. We disabled all site validation and we configured minTLSVersion 1.2. Please find below code snippet
static let serverTrustPolicies:[String: ServerTrustEvaluating] = {
var sites = [String]()
sites.append("apis.xyz.com")
return sites.reduce([String: ServerTrustEvaluating]()) { (dictionary, site) -> [String: Alamofire.ServerTrustEvaluating] in
var dictionary = dictionary
dictionary[site] = DisabledTrustEvaluator()
return dictionary
}
}()
static let manager: Session = {
var serverTrustPolicies: [String: ServerTrustEvaluating] = NetworkClient.serverTrustPolicies
let configuration = URLSessionConfiguration.default
configuration.tlsMinimumSupportedProtocolVersion = .TLSv12
return Alamofire.Session(configuration: configuration,
serverTrustManager: CustomTrustManager(evaluators: serverTrustPolicies))
}()
error from Alamofire
Topic:
App & System Services
SubTopic:
Networking