如何设置应用程序仅信任一个SSL证书



我有一个iPhone应用,需要安全连接到我的WebS服务

我有一个我创建并要添加到应用程序的CA,因此它可以创建连接并验证我的服务器

我正在使用RESTKIT 0.20.3提出请求。

如何配置AFHHTTPClient以信任我的证书?

仅添加您的URL,因为 https:// formate会这样做,因为您的信息将根据SSL证书加密

在Asihttprequest客户端证书中支持如果您的服务器需要使用客户端证书,则截至v1.8现在可以随您的请求发送它们。

// 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]];

clientCertificateTests.m iPhone/iPad示例应用程序中有一个辅助功能,可以从PKCS12数据创建SECIndentityRef(此函数仅在iOS上起作用)。

并在此处查找有关在iOS End上处理自签名证书的更多信息:

在iPhone应用中使用自签名的SSL证书

iPhone:SSL连接的安装证书

最新更新