SSL会话重用问题在Android中(J2SE正常工作) [英] SSL Session Reuse Problems In Android (J2SE works fine)

查看:255
本文介绍了SSL会话重用问题在Android中(J2SE正常工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在iOS,Java的桌面和Android SSL会话重用。的iOS似乎尝试重用SSL会话(但不是所有的时间)。 Java的出现,只要你通过主机名/端口,当你创建一个SSLEngine时总是重复使用会话。

I have been trying out SSL session reuse on iOS, Java desktop and Android. iOS appears to try to reuse SSL sessions (but not all the time). Java appears to always reuse sessions as long as you pass the hostname/port when you create an SSLEngine.

当我得到到Android我有一些问题。在code这是我用来测试Java的SSL会话重用(创建一个连接,发送一对夫妇的消息,丢弃连接,并等待一秒钟,重复)并没有对正常升级Froyo在所有的工作,曾在姜饼模拟器但没有重用会话。

When I get to Android I have some problems. The code which I used to test Java SSL session reuse (create a connection, send a couple of messages, drop the connection and wait one second, repeat) didn't work properly at all on Froyo, worked in the Gingerbread emulator but didn't reuse sessions.

然后我看了一点点深入的Andr​​oid code和我看到有存储使用SSLSessionCache / SSLCertificateSocketFactory这是由AndroidHttpClient使用SSL会话的另一种方法。所以,我成立了一个测试使用哪个移交给Apache服务器的多个连接(我知道支持SSL会话重用)多个请求AndroidHttpClient,它仍然没有重用升级Froyo或姜饼会议。

I then looked a little deeper into the Android code and I see there is an alternate method of storing SSL sessions using the SSLSessionCache/SSLCertificateSocketFactory which are used by the AndroidHttpClient. So I set up a test to use the AndroidHttpClient which made multiple requests over multiple connections to an apache server (which I know supports SSL session reuse), and it still didn't reuse sessions in Froyo or in Gingerbread.

如果有人已经能够得到这个工作,并可能表现出一定的样本Android客户端code我会更AP preciated。我正在考虑创建Android的一个bug报告,但我只是想确保我不缺少明显的东西在这里。

If anyone has been able to get this working and could show some sample Android client code I would be much appreciated. I am considering creating a bug report for Android, but I just want to make sure I am not missing something obvious here.

推荐答案

它的工作对我来说在Froyo的,虽然它是一个绝对的屁股获得工作,看到我的帖子:

It's working for me in Froyo, although it was an absolute arse to get working, see my post:

<一个href=\"http://stackoverflow.com/questions/5643704/reusing-ssl-sessions-in-android-with-httpclient/5672013#5672013\">Reusing在Android的SSL会话与HttpClient的

这篇关于SSL会话重用问题在Android中(J2SE正常工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆