question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Picasso not loading images from https urls

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:24 (5 by maintainers)

github_iconTop GitHub Comments

34reactions
JakeWhartoncommented, May 10, 2015

We charge $10 to enable HTTPS.

On Sun, May 10, 2015, 9:20 AM tamawy notifications@github.com wrote:

Use Universal Image Loader instead. It supports HTTPS by default https://github.com/nostra13/Android-Universal-Image-Loader

— Reply to this email directly or view it on GitHub https://github.com/square/picasso/issues/500#issuecomment-100640546.

20reactions
JakeWhartoncommented, May 8, 2014

This might be a bug in the SPDY support of OkHttp and how Flickr’s servers behave. You can disable SPDY with this:

OkHttpClient client = new OkHttpClient();
client.setProtocols(Arrays.asList(Protocol.HTTP_11));
Picasso picasso = new Picasso.Builder(context)
    .downloader(new OkDownloader(client))
    .build();

Downside here is that you have to carry that picasso reference around your app rather than using Picasso.with(context).

We should really provide a way to configure the global singleton…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Picasso Image does not load - Stack Overflow
In Picasso you shoud pass url in .load() method to load picture from internet and object of File type to load picture from...
Read more >
Displaying Images with the Picasso Library
Displaying images is easiest using a third party library such as Picasso from Square which will download and cache remote images and abstract...
Read more >
How to Use Picasso Image Loader Library in Android?
Picasso simplifies the process of loading images from external URLs and displays them on your application. For example, downloading an image ...
Read more >
Android – Picasso not loading image from http url but loads ...
Picasso Loads the image fine if its from a https url like: ... code to retrieve the images whereever required on the app...
Read more >
Using Picasso in Android | Engineering Education (EngEd ...
Image loading : This refers to accessing an image via a URL. ... Picasso does not support GIF animation on a simple image...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found