Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用SSL身份验证在iOS中发布HTTPS:cURL?_Ios_Object_Curl_Libcurl - Fatal编程技术网

使用SSL身份验证在iOS中发布HTTPS:cURL?

使用SSL身份验证在iOS中发布HTTPS:cURL?,ios,object,curl,libcurl,Ios,Object,Curl,Libcurl,我想使用包含我的私钥和证书以及服务器的CACertificate的两个PEM文件向服务器发送HTTPS。我已经在windows应用程序中做了一段时间了,它工作正常。现在我必须在iPad上的iOS应用程序上做同样的事情。Cocoa框架似乎没有针对此类请求的功能。。。任何关于如何做到这一点或如何在iOS设备上实现cURL的想法都将不胜感激 更新:我最终使用了针对ios5.1编译的cURL和openSSL。很好用。也许能帮上忙 方法 虽然我还没有使用证书函数,但是ASIHTTPRequest是一个非常

我想使用包含我的私钥和证书以及服务器的CACertificate的两个PEM文件向服务器发送HTTPS。我已经在windows应用程序中做了一段时间了,它工作正常。现在我必须在iPad上的iOS应用程序上做同样的事情。Cocoa框架似乎没有针对此类请求的功能。。。任何关于如何做到这一点或如何在iOS设备上实现cURL的想法都将不胜感激

更新:我最终使用了针对ios5.1编译的cURL和openSSL。很好用。

也许能帮上忙

方法


虽然我还没有使用证书函数,但是ASIHTTPRequest是一个非常好的工具,可以让您的网络快速、轻松地运行。我建议从那里开始。请记住ASIHTTPRequest已不再处于积极开发中。只有当您了解它的内部工作原理,并且愿意在将来的iOS版本出现故障时(大量)使用它。这就是说:我还在我的一个项目中使用ASI进行客户端证书身份验证,它工作得非常好。@xCoder同意,但ASI是一个非常好的框架,甚至比AFNetwork更好
 If your server requires the use of client certificates, as of v1.8 it
 is now possible to send them with your request.

    // Will send the certificate attached to the identity (identity is a SecIdentityRef)
    [request setClientCertificateIdentity:identity];

    // Add an additional certificate (where cert is a SecCertificateRef)
    [request setClientCertificates:[NSArray arrayWithObject:(id)cert]];

 There is a helper function in ClientCertificateTests.m in the iPhone /
 iPad sample app that can create a SecIdentityRef from PKCS12 data
 (this function only works on iOS).