我一直在为 iPhone 测试应用程序使用 twitter API,但我错过了使用 Charles (http://www.charlesproxy.com) 等软件代理我对 twitter API 所做的请求的能力/)。尽管 Twitter 具有 SSL 代理功能,但它似乎不喜欢中间有不同的证书对请求进行签名这一事实。 有什么办法可以做到这一点吗?如果能够查看请求以及 Charles 格式化 JSON 响应的方式等,我会非常有用...
最佳答案
Twitter 无法知道中间有一个人。我没用过Charles,但我用过Fiddler2。试试那个。
http://www.charlesproxy.com/documentation/proxying/ssl-proxying/
http://www.fiddler2.com/fiddler/help/httpsdecryption.asp
解密 HTTPS 的原理是代理制作自己的证书并将其提供给浏览器。浏览器会注意到它连接了一个错误的证书并发出警告,但服务器(Twitter)只会将代理视为另一个浏览器。代理服务器连接使用 Twitter 的证书,因此仍然安全。
也许这是你的问题:
Q: Can Fiddler intercept traffic from Apple iOS devices like iPad/iPhone/iPod Touch and Android devices? A: Yes, but these devices may not be compatible with the default certificates Fiddler generates.
To resolve the incompatibility, you may replace Fiddler's default certificate generator with one that generates certificates containing flags (e.g. AKID, SKID) that are compatible with these platforms. Simply download and install the new Certificate Maker and restart Fiddler.
关于将 OAuth 请求代理到 Twitter API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7467612/