glide icon indicating copy to clipboard operation
glide copied to clipboard

Not loading images from HTTPS URLs on lower(!) Android versions but works fine on most recent versions

Open theAkito opened this issue 2 years ago • 7 comments

Glide Version: 4.11.0

Integration libraries: No.

Device/Android Version: Galaxy Nexus with API 23 Emulator through Android Studio. Works fine on same emulator with currently (as of 2021) most recent Android versions.

Issue details / Repro steps / Use case background: https://github.com/bumptech/glide/issues/1726 https://github.com/bumptech/glide/issues/4563

Glide load line / GlideModule (if any) / list Adapter code (if any):

val glideListener = object : RequestListener<Drawable> {
            override fun onLoadFailed(e: GlideException?, model: Any?, target: com.bumptech.glide.request.target.Target<Drawable>?, isFirstResource: Boolean): Boolean {
              return true
            }

            override fun onResourceReady(resource: Drawable?, model: Any?, target: com.bumptech.glide.request.target.Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
              return true
            }
          }
Glide
              .with(binding.imgLogo.context)
              .load(iconUrlFull)
              .listener(glideListener)
              .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
              .skipMemoryCache(true)
              .apply(RequestOptions.circleCropTransform())
              .into(binding.imgLogo)

Stack trace / LogCat: https://github.com/bumptech/glide/issues/4563


I am trying to fetch website icons through URLs that are proven to work. When running Code A and fetching the icons through Glide on most recent Android API versions, all works as expected. However, if running the same exact Code A and doing precisely the same thing on lower Android API versions (for example API 23), then Glide fails with a trust anchor exception.

I am disappointed to see that it is recommended to use unsafe workarounds by making OkHttp disable certificate validation, etc., especially when forcing it upon 3rd party software maintainers, when this is undeniably a bug with Glide. The same implementation works in newer Android versions, but not older ones. So, instead of recommending voodoo or just making it worse, Glide should have this issue fixed, internally, in the best way possible.

P.S.: It's not a bug with Android, because I can fetch the same images on Android API 23 through Apache HTTP Client. So, clearly, this is fixable, without unsafe voodoo workarounds, that make the situation worse, instead of fixing it.

theAkito avatar Dec 04 '21 15:12 theAkito

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 17:01 stale[bot]

Still relevant.

theAkito avatar Jan 13 '22 11:01 theAkito

I have the same issue - seen this issue on a Nexus and older Samsung tablet. On both devices, Glide works fine outside recycler view.

RStavnager avatar May 05 '22 21:05 RStavnager

Yup still relevant

BjornLarsen1 avatar May 06 '22 07:05 BjornLarsen1

I have the exact issue on my Samsung Tablet as well.

KarlHolch avatar May 06 '22 07:05 KarlHolch

This is also an issue for me.

au636574 avatar May 07 '22 11:05 au636574

This is still an issue, any updates?

RStavnager avatar Jun 17 '22 23:06 RStavnager