本文介绍了ASIHTTPRequest:使用SSL进行https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用SSL和 ASIHTTPRequest 实现https连接?有一些特殊的步骤吗?这可能与 ASIHTTPRequest 无关吗?我认为它只能用于服务器端。有人可以发布链接或描述如何建立https连接的过程吗?



这是我到目前为止所发现的:



我在某处读到你需要一个真正的SSL证书,而不是一个自签名证书。我认为也不支持所有SSL证书提供商(请参阅)。



您还必须遵守美国政府对CCATS审查和批准的要求。 (参见)。

解决方案

所以你在这里有几个问题:


  1. 要使用ASIHTTPRequest执行SSL,您只需传递https网址而不是http网址。


  2. 您不需要真正的SSL证书,您可以使用以下命令禁用验证:[request setValidatesSecureCertificate:NO] ;.禁用证书验证确实意味着您失去了SSL提供的一些保护,使您容易受到中间人攻击等的攻击。


  3. 是的,你受限于iPhone支持的证书签名机构。只要你坚持大名鼎鼎,就不应该成为一个问题。 (根据2.你可以使用自签名证书。)


  4. 似乎CCATS不再需要了,你需要一个ERN - 这个过程有自2010年夏季开始改变!请参阅。如果您想在法国应用程序商店中分发,还有其他限制,请参阅。



How to implement a https connection with SSL and ASIHTTPRequest? Are there some special steps to do? Can it be that this has nothing to do with ASIHTTPRequest? It has to do only with the server-side I think. Can someone post a link or describe the process of how a https connection can be established?

This is what I found out so far:

I read somewhere that you need a "real" SSL certificate and not a self signed one. There are also not all provider of SSL certificates supported I think (read this).

You also have to run through the U.S. Government requirement for a CCATS review and approval. (see here).

解决方案

So you've got a few questions here:

  1. To do SSL with ASIHTTPRequest, you just need to pass a https url instead of a http one.

  2. you don't need a real SSL certificate, you can disable validation using: [request setValidatesSecureCertificate:NO];. Disabling certificate validation does mean you lose some of the protection that SSL provides, making you vulnerable to man-in-the-middle attacks etc.

  3. Yes, you're limited by what certificate signing authorities are supported by the iPhone. So long as you stick to the big names it shouldn't really be an issue. (And as per 2. you can use a self signed certificate anyway.)

  4. It seems CCATS not necessary anymore, you need an ERN instead - the process has changed, as of Summer 2010! See http://tigelane.blogspot.com/2011/01/apple-itunes-export-restrictions-on.html. There are also extra restrictions if you want to distribute on the French app store, see Using SSL in an iPhone App - Export Compliance.

这篇关于ASIHTTPRequest:使用SSL进行https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 03:02
查看更多