簡體   English   中英

帶有SSL身份驗證的iOS中的HTTPS POST:cURL?

[英]HTTPS POST in iOS with SSL authentication: cURL?

我想使用兩個包含我的私鑰和證書的PEM文件以及服務器的CACertificate對服務器進行HTTPS POST。 我已經從Windows應用程序中做了一段時間,它的工作正常。 現在我必須從iPad上的iOS應用程序執行相同的操作。 似乎Cocoa框架沒有針對此類請求的功能......任何有關如何執行此操作或如何在iOS設備上引入cURL的想法都將受到贊賞。

更新:我最終使用openSSL為iOS 5.1編譯的cURL。 完美的工作。

也許ASIHTTPRequest可以幫助

客戶證書方法

 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).

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM