Use untrusted certificate of server api call in swift iOS
Problem:
I want to call api with untrusted certificate using alomafire swift.
Solution:
if let cook = Sessions().getCookie() {
HTTPCookieStorage.shared.setCo
}
let session: Session = {
let manager = ServerTrustManager(evaluators: ["192.168.1.15": DisabledTrustEvaluator()])
let configuration = URLSessionConfiguration.af.def
return Session(configuration: configuration, serverTrustManager: manager)
}()
Instead of af.request use session.request ....
Happy coding..
Comments
Post a Comment