I'm developing an iOS app that needs to do a HTTPS POST on a remote server. Here's what I want to do:
// How to initialize 'credential' with a certificate.der (or .pem)
var credential: URLCredential?
let pms: [String: Any] = ["func": "os.getpid"]
Alamofire.request("https://mytestdomain.mycom/exec", method: .post,
parameters: pms, encoding: JSONEncoding.default, headers: nil)
.authenticate(usingCredential: credential!)
.responseJSON { response in
if response.result.isSuccess {
print("Success")
}
else {
print("Error")
}
But I haven't found a way to initialize the credential with a certificate. Is it possible?