安卓:某些设备无法使用我的应用程序的网络服务的用户 - SSLPeerUnverifiedException [英] Android: Users with certain devices cannot use my application's web-services - SSLPeerUnverifiedException

查看:182
本文介绍了安卓:某些设备无法使用我的应用程序的网络服务的用户 - SSLPeerUnverifiedException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有交互通过HTTPS与服务器我有一个应用程序。我有一个有效的证书。

应用程序工作正常,对于大多数用户,但一些用户报告说,他们有问题,他们的根设备的连接。他们还与HTC的Evo 2.3.3报告,与Sprint的升级,应用程序具有相同的行为。

我借了朋友的演化,并能得到下面的下面的堆栈跟踪。我已经看到了解决方案,这里面基本上都是接受所有证书,但是这是不可能的,因为我在生产中发布此。

有没有人见过这样的定位?可能直接在设备上存储我的服务器的证书?

  06-24 15:15:52.051:WARN / ServiceOperation(1535):javax.net.ssl​​.SSLPeerUnverifiedException:没有对方的证书
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:258)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:164)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
06-24 15:15:52.051:WARN / ServiceOperation(1535):在org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
 

解决方案

这似乎与创造了一个问题,HTC,当他们发布了2.3.3。有一个关于它的缺陷报告在这里:的http:// code.google.com / P /安卓/问题/详细信息?ID = 16885#C7

我要的东西硬编码到应用程序不下来,所以我想现在我不会支持这些用户。

I have an application which interacts over https with a server I have. I have a valid certificate.

The application works fine for most users, but some users are reporting that they have problems connecting with their rooted devices. They are also reporting with the HTC Evo 2.3.3, with the upgrade from Sprint, the application has the same behavior.

I borrowed a friends' Evo, and was able to get the following stack-trace below. I have seen solutions for this which are basically 'accept all certs' but that is not possible since I am releasing this in production.

Has anyone seen a fix for this? Possibly storing my server's cert directly on the device?

06-24 15:15:52.051: WARN/ServiceOperation(1535): javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:258)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:164)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
06-24 15:15:52.051: WARN/ServiceOperation(1535):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)

解决方案

It seems related to a issue HTC created when they released 2.3.3. There's a bug report about it here: http://code.google.com/p/android/issues/detail?id=16885#c7

I'm going to hold off on hardcoding anything into the application, So I guess for now I won't support these users.

这篇关于安卓:某些设备无法使用我的应用程序的网络服务的用户 - SSLPeerUnverifiedException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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