我开发了一个Android应用程序,其中从Amazon S3存储桶下载图像和音频。在所有设备(索尼xperia sola,HTC Salasa,Micromax funbook,三星标签2)和Android模拟器中,它完美下载。
但是当我尝试下载图像和音频时。它给了我像
这样的错误04-01 03:58:01.148: W/System.err(15854): com.amazonaws.AmazonClientException: Unable to execute HTTP request: No peer certificate
04-01 03:58:01.148: W/System.err(15854): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:332)
04-01 03:58:01.148: W/System.err(15854): at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:167)
04-01 03:58:01.148: W/System.err(15854): at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:2781)
04-01 03:58:01.148: W/System.err(15854): at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:872)
04-01 03:58:01.148: W/System.err(15854): at org.Infoware.famouspeople.DownloadThread.run(DownloadThread.java:122)
04-01 03:58:01.148: W/System.err(15854): Caused by: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
04-01 03:58:01.148: W/System.err(15854): at org.apache.harmony.xnet.provider.jsse.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:258)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:93)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:381)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:164)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
04-01 03:58:01.148: W/System.err(15854): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
04-01 03:58:01.148: W/System.err(15854): at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:285)
04-01 03:58:01.148: W/System.err(15854): ... 4 more
任何人都可以帮我解决这个问题吗?
答案 0 :(得分:1)
我也有这个问题。事实证明,这是由wifi路由器上的透明HTTP(S)代理重定向到wifi登录页面引起的。可能值得检查一下。如果您在wifi网络上的授权超时,则错误可能会出现间歇性。
答案 1 :(得分:0)
对我来说,我只是将android版本更改为4.1并解决了问题。请尝试使用您的代码,这可能会对您有所帮助。