picasso: Picasso not loading images from https urls
Hi,
I’m running a simple test where I try to get a photo from Flickr like so:
Picasso.with(context)
.load("https://farm6.staticflickr.com/5294/5460063960_1ef2d5c216_o.jpg")
.resize(width, height)
.into(target);
Problem is, if I use https, the loading fails with a timeout. It doesn’t happen if I use http instead. Is there any config setting I could use or something else that can be done or that I am missing? Below is the stack trace.
Thank you!
java.net.SocketTimeoutException: Read timed out at com.squareup.okhttp.internal.spdy.SpdyStream$SpdyDataSource.waitUntilReadable(SpdyStream.java:417) at com.squareup.okhttp.internal.spdy.SpdyStream$SpdyDataSource.read(SpdyStream.java:368) at com.squareup.okhttp.internal.http.SpdyTransport$SpdySource.read(SpdyTransport.java:268) at com.squareup.okhttp.internal.okio.RealBufferedSource$1.read(RealBufferedSource.java:168) at java.io.InputStream.read(InputStream.java:163) at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142) at java.io.BufferedInputStream.read(BufferedInputStream.java:309) at com.squareup.picasso.MarkableInputStream.read(MarkableInputStream.java:138) at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:664) at com.squareup.picasso.NetworkBitmapHunter.decodeStream(NetworkBitmapHunter.java:108) at com.squareup.picasso.NetworkBitmapHunter.decode(NetworkBitmapHunter.java:60) at com.squareup.picasso.BitmapHunter.hunt(BitmapHunter.java:123) at com.squareup.picasso.BitmapHunter.run(BitmapHunter.java:83) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856) at com.squareup.picasso.Utils$PicassoThread.run(Utils.java:306)
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 24 (5 by maintainers)
We charge $10 to enable HTTPS.
On Sun, May 10, 2015, 9:20 AM tamawy notifications@github.com wrote:
This might be a bug in the SPDY support of OkHttp and how Flickr’s servers behave. You can disable SPDY with this:
Downside here is that you have to carry that
picasso
reference around your app rather than usingPicasso.with(context)
.We should really provide a way to configure the global singleton…
@alikamts with that combination of dependencies you probably need something more like
where the
OkHttp3Downloader
instance is supplied by this library.First, I’d like to thank you for your response. Second, don’t make jokes with me again 😄. Third, someone on StackOverFlow asked a question about the same issue and on of the answer was recommending to him to implement TrustAllCerts and initialize the instance with it ( http://stackoverflow.com/a/26398617/1364896). I will expect that this is right, but if you think I should do something else or something missing, let me know please. Thanks again.
BTW, you, personally, were the center of a conversation between some Android developers few weeks ago in Android development conference in Dubai 😃
On Thu, May 21, 2015 at 6:53 AM, Jake Wharton notifications@github.com wrote:
Regards,
Sami El-Tamawy Software engineer Insydo Dubai, UAE Mobile: (+971) 52565 9772 Skypid: a.s.tamawy
Hey guys I have made
CustomPicasso
gist which supports image URL redirection using @JakeWharton’s picasso2-okhttp3-downloaderCustomPicasso
gist - https://gist.github.com/hrishikesh-kadam/09cef31c736de088313f1a102f5ed3a3Usage -