bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.59k stars 6.12k forks source link

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

Open theAkito opened 2 years ago

theAkito commented 2 years ago

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.

stale[bot] commented 2 years ago

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.

theAkito commented 2 years ago

Still relevant.

RStavnager commented 2 years ago

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

BjornLarsen1 commented 2 years ago

Yup still relevant

KarlHolch commented 2 years ago

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

au636574 commented 2 years ago

This is also an issue for me.

RStavnager commented 2 years ago

This is still an issue, any updates?